From 82423d51e3bddb2dbb522db6eb810765c0bcf23b Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 4 Jan 2002 16:48:13 +0000 Subject: [PATCH] libmpeg2 is now able to decode framecopied (with mencoder) mpeg files git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3981 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/video.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/libmpdemux/video.c b/libmpdemux/video.c index e1bce99b6c..14aaff2f55 100644 --- a/libmpdemux/video.c +++ b/libmpdemux/video.c @@ -32,10 +32,38 @@ switch(d_video->demuxer->file_format){ sh_video->format=sh_video->bih->biCompression; sh_video->disp_w=sh_video->bih->biWidth; sh_video->disp_h=abs(sh_video->bih->biHeight); + +#if 1 + /* hack to support decoding of mpeg1 chunks in AVI's with libmpeg2 -- 2002 alex */ + if ((sh_video->format == 0x10000001) || + (sh_video->format == 0x10000002) || + (sh_video->format == mmioFOURCC('m','p','g','1')) || + (sh_video->format == mmioFOURCC('M','P','G','1')) || + (sh_video->format == mmioFOURCC('m','p','g','2')) || + (sh_video->format == mmioFOURCC('M','P','G','2')) || + (sh_video->format == mmioFOURCC('m','p','e','g')) || + (sh_video->format == mmioFOURCC('m','p','e','g'))) + { + int saved_pos, saved_type; + + /* demuxer pos saving is required for libavcodec mpeg decoder as it's + reading the mpeg header self! */ + + saved_pos = d_video->buffer_pos; + saved_type = d_video->demuxer->file_format; + + d_video->demuxer->file_format = DEMUXER_TYPE_MPEG_ES; + video_read_properties(sh_video); + d_video->demuxer->file_format = saved_type; + d_video->buffer_pos = saved_pos; +// goto mpeg_header_parser; + } +#endif break; } case DEMUXER_TYPE_MPEG_ES: case DEMUXER_TYPE_MPEG_PS: { +//mpeg_header_parser: // Find sequence_header first: videobuf_len=0; videobuf_code_len=0; mp_msg(MSGT_DECVIDEO,MSGL_V,"Searching for sequence header... ");fflush(stdout);