[Mplayer-cvslog] CVS: main/libmpdemux video.c,1.6,1.7

Alex Beregszaszi alex at mplayer.dev.hu
Fri Jan 4 17:48:15 CET 2002


Update of /cvsroot/mplayer/main/libmpdemux
In directory mplayer:/var/tmp.root/cvs-serv26585

Modified Files:
	video.c 
Log Message:
libmpeg2 is now able to decode framecopied (with mencoder) mpeg files

Index: video.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/video.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- video.c	25 Dec 2001 11:20:58 -0000	1.6
+++ video.c	4 Jan 2002 16:48:13 -0000	1.7
@@ -32,10 +32,38 @@
     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);




More information about the MPlayer-cvslog mailing list