# HG changeset patch # User arpi # Date 1003080589 0 # Node ID d5a44e828ae48ab8ac6c75051e17bc15c0457039 # Parent d67223ae168fe42623cff52cc9ad8dba2029fc36 mpeg2 fps fix by Ivan Kalvatchev diff -r d67223ae168f -r d5a44e828ae4 libmpeg2/header.c --- a/libmpeg2/header.c Sun Oct 14 17:11:17 2001 +0000 +++ b/libmpeg2/header.c Sun Oct 14 17:29:49 2001 +0000 @@ -203,6 +203,7 @@ picture->repeat_first_field = (buffer[3] >> 1) & 1; picture->progressive_frame = buffer[4] >> 7; +#if 0 // repeat_first implementation by A'rpi/ESP-team, based on libmpeg3: if(picture->repeat_count>=100) picture->repeat_count=0; if(picture->repeat_first_field){ @@ -216,7 +217,30 @@ picture->repeat_count+=50; } } + //repeat_count=display_time-100% +#else + // repeat_first implemantation by iive, based on A'rpi/ESP-team and libmpeg3 + if( picture->progressive_sequence == 1 ) + { + if( picture->repeat_first_field == 0 ) picture->display_time=100;//normal + else + { + if( picture->top_field_first == 0 ) picture->display_time=200;//2 frames + else picture->display_time=300;//3 frames + } + }else + { + if( picture->progressive_frame == 0 ) + picture->display_time=100;//2fields, interlaced in time + else + { + if( picture->top_field_first == 0 ) picture->display_time=100;//reconstruct 2 fields + else picture->display_time = 150;//reconstruct 3 fields + } + if( picture->picture_structure!=3 ) picture->display_time/=2;//we calc on every field + } +#endif return 0; } diff -r d67223ae168f -r d5a44e828ae4 libmpeg2/mpeg2_internal.h --- a/libmpeg2/mpeg2_internal.h Sun Oct 14 17:11:17 2001 +0000 +++ b/libmpeg2/mpeg2_internal.h Sun Oct 14 17:29:49 2001 +0000 @@ -146,7 +146,7 @@ int display_picture_width; int display_picture_height; int pp_options; - int repeat_count; + int display_time; struct vo_frame_s * display_frame; int slice; diff -r d67223ae168f -r d5a44e828ae4 mplayer.c --- a/mplayer.c Sun Oct 14 17:11:17 2001 +0000 +++ b/mplayer.c Sun Oct 14 17:29:49 2001 +0000 @@ -1327,8 +1327,8 @@ } // fix mpeg2 frametime: - frame_time=(100+picture->repeat_count)*0.01f; - picture->repeat_count=0; + frame_time=(picture->display_time)*0.01f; + picture->display_time=100; videobuf_len=0; } else {