diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-03-10 00:52:17 +0200 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-03-10 00:52:17 +0200 |
commit | 5099b1458d6a5e57b4ebd7c6dfc07dbbd405a652 (patch) | |
tree | 705780fb6af4cdc0836a10a409fbd51495ec1142 /libmpdemux | |
parent | 5eeba24ab73e4ae64d7212a9ceef3fb8801fe8a8 (diff) | |
parent | 160b880c4fd10cec41ba2c14c846d0a7e7f21048 (diff) | |
download | mpv-5099b1458d6a5e57b4ebd7c6dfc07dbbd405a652.tar.bz2 mpv-5099b1458d6a5e57b4ebd7c6dfc07dbbd405a652.tar.xz |
Merge svn changes up to r30683
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/mp_taglists.c | 2 | ||||
-rw-r--r-- | libmpdemux/mpeg_hdr.c | 5 | ||||
-rw-r--r-- | libmpdemux/mpeg_hdr.h | 2 | ||||
-rw-r--r-- | libmpdemux/video.c | 12 |
4 files changed, 16 insertions, 5 deletions
diff --git a/libmpdemux/mp_taglists.c b/libmpdemux/mp_taglists.c index eab8316e02..adfe1059b2 100644 --- a/libmpdemux/mp_taglists.c +++ b/libmpdemux/mp_taglists.c @@ -33,6 +33,8 @@ static const struct mp_AVCodecTag mp_wav_tags[] = { { CODEC_ID_ADPCM_THP, MKTAG('T', 'H', 'P', 'A')}, { CODEC_ID_ADPCM_XA, MKTAG('P', 'S', 'X', 'A')}, { CODEC_ID_AMR_NB, MKTAG('n', 'b', 0, 0)}, + { CODEC_ID_BINKAUDIO_DCT, MKTAG('B', 'A', 'U', '1')}, + { CODEC_ID_BINKAUDIO_RDFT, MKTAG('B', 'A', 'U', '2')}, { CODEC_ID_COOK, MKTAG('c', 'o', 'o', 'k')}, { CODEC_ID_DSICINAUDIO, MKTAG('D', 'C', 'I', 'A')}, { CODEC_ID_EAC3, MKTAG('E', 'A', 'C', '3')}, diff --git a/libmpdemux/mpeg_hdr.c b/libmpdemux/mpeg_hdr.c index c07cd6bf16..d91019ad13 100644 --- a/libmpdemux/mpeg_hdr.c +++ b/libmpdemux/mpeg_hdr.c @@ -67,6 +67,8 @@ int mp_header_process_sequence_header (mp_mpeg_header_t * picture, const unsigne picture->mpeg1 = 1; picture->picture_structure = 3; //FRAME_PICTURE; picture->display_time=100; + picture->frame_rate_extension_n = 1; + picture->frame_rate_extension_d = 1; return 0; } @@ -81,6 +83,9 @@ static int header_process_sequence_extension (mp_mpeg_header_t * picture, return 1; picture->progressive_sequence = (buffer[1] >> 3) & 1; + picture->frame_rate_extension_n = ((buffer[5] >> 5) & 3) + 1; + picture->frame_rate_extension_d = (buffer[5] & 0x1f) + 1; + picture->mpeg1 = 0; return 0; } diff --git a/libmpdemux/mpeg_hdr.h b/libmpdemux/mpeg_hdr.h index d9922767b2..ccd84bcdb0 100644 --- a/libmpdemux/mpeg_hdr.h +++ b/libmpdemux/mpeg_hdr.h @@ -27,6 +27,8 @@ typedef struct { int aspect_ratio_information; int frame_rate_code; float fps; + int frame_rate_extension_n; + int frame_rate_extension_d; int bitrate; // 0x3FFFF==VBR // timing: int picture_structure; diff --git a/libmpdemux/video.c b/libmpdemux/video.c index 7ba2e8049f..f29f83bf9b 100644 --- a/libmpdemux/video.c +++ b/libmpdemux/video.c @@ -318,7 +318,7 @@ mpeg_header_parser: // display info: sh_video->format=picture.mpeg1?0x10000001:0x10000002; // mpeg video - sh_video->fps=picture.fps; + sh_video->fps=picture.fps * picture.frame_rate_extension_n / picture.frame_rate_extension_d; if(!sh_video->fps){ sh_video->frametime=0; } else { @@ -433,6 +433,7 @@ int video_read_frame(sh_video_t* sh_video,float* frame_time_ptr,unsigned char** float frame_time=1; float pts1=d_video->pts; float pts=0; + float fps; int picture_coding_type=0; int in_size=0; video_codec_t video_codec = find_video_codec(sh_video); @@ -469,14 +470,15 @@ int video_read_frame(sh_video_t* sh_video,float* frame_time_ptr,unsigned char** case 0x100: picture_coding_type=(videobuffer[start+1] >> 3) & 7;break; } } + fps = picture.fps * picture.frame_rate_extension_n / picture.frame_rate_extension_d; *start=videobuffer; in_size=videobuf_len; // get mpeg fps: - if(sh_video->fps!=picture.fps) if(!force_fps && !telecine){ - mp_msg(MSGT_CPLAYER,MSGL_WARN,"Warning! FPS changed %5.3f -> %5.3f (%f) [%d] \n",sh_video->fps,picture.fps,sh_video->fps-picture.fps,picture.frame_rate_code); - sh_video->fps=picture.fps; - sh_video->frametime=1.0/picture.fps; + if(sh_video->fps!=fps) if(!force_fps && !telecine){ + mp_msg(MSGT_CPLAYER,MSGL_WARN,"Warning! FPS changed %5.3f -> %5.3f (%f) [%d] \n",sh_video->fps,fps,sh_video->fps-fps,picture.frame_rate_code); + sh_video->fps=fps; + sh_video->frametime=1.0/fps; } // fix mpeg2 frametime: |