1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-24 15:52:25 +00:00

mpeg2 fps fix by Ivan Kalvatchev <iive@yahoo.com>

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2197 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2001-10-14 17:29:49 +00:00
parent 3a2c8617a5
commit 2a7a438b7d
3 changed files with 27 additions and 3 deletions

View File

@ -203,6 +203,7 @@ static int header_process_picture_coding_extension (picture_t * picture, uint8_t
picture->repeat_first_field = (buffer[3] >> 1) & 1; picture->repeat_first_field = (buffer[3] >> 1) & 1;
picture->progressive_frame = buffer[4] >> 7; picture->progressive_frame = buffer[4] >> 7;
#if 0
// repeat_first implementation by A'rpi/ESP-team, based on libmpeg3: // repeat_first implementation by A'rpi/ESP-team, based on libmpeg3:
if(picture->repeat_count>=100) picture->repeat_count=0; if(picture->repeat_count>=100) picture->repeat_count=0;
if(picture->repeat_first_field){ if(picture->repeat_first_field){
@ -216,7 +217,30 @@ static int header_process_picture_coding_extension (picture_t * picture, uint8_t
picture->repeat_count+=50; 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; return 0;
} }

View File

@ -146,7 +146,7 @@ typedef struct picture_s {
int display_picture_width; int display_picture_width;
int display_picture_height; int display_picture_height;
int pp_options; int pp_options;
int repeat_count; int display_time;
struct vo_frame_s * display_frame; struct vo_frame_s * display_frame;
int slice; int slice;

View File

@ -1327,8 +1327,8 @@ if(1)
} }
// fix mpeg2 frametime: // fix mpeg2 frametime:
frame_time=(100+picture->repeat_count)*0.01f; frame_time=(picture->display_time)*0.01f;
picture->repeat_count=0; picture->display_time=100;
videobuf_len=0; videobuf_len=0;
} else { } else {