[Mplayer-cvslog] CVS: main/libmpdemux demux_mpg.c,1.35,1.36 demuxer.c,1.56,1.57

Arpi of Ize arpi at mplayer.dev.hu
Wed Dec 26 17:34:08 CET 2001


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

Modified Files:
	demux_mpg.c demuxer.c 
Log Message:
mpeg VDR vs. BIN fixed?

Index: demux_mpg.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_mpg.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- demux_mpg.c	1 Dec 2001 22:09:18 -0000	1.35
+++ demux_mpg.c	26 Dec 2001 16:34:06 -0000	1.36
@@ -278,8 +278,8 @@
   // sure: head=0x000001XX
   mp_dbg(MSGT_DEMUX,MSGL_DBG4,"*** head=0x%X\n",head);
   if(demux->synced==0){
-    if(head==0x1BA) demux->synced=1; else
-    if(head==0x1BD || (head>=0x1C0 && head<=0x1EF)) demux->synced=3; // PES?
+    if(head==0x1BA) demux->synced=1; //else
+//    if(head==0x1BD || (head>=0x1C0 && head<=0x1EF)) demux->synced=3; // PES?
   } else
   if(demux->synced==1){
     if(head==0x1BB || head==0x1BD || (head>=0x1C0 && head<=0x1EF)){

Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- demuxer.c	17 Dec 2001 00:24:03 -0000	1.56
+++ demuxer.c	26 Dec 2001 16:34:06 -0000	1.57
@@ -441,9 +441,20 @@
 //=============== Try to open as MPEG-PS file: =================
 if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_MPEG_PS){
  int pes=1;
+ int tmp;
  while(pes>=0){
   demuxer=new_demuxer(stream,DEMUXER_TYPE_MPEG_PS,audio_id,video_id,dvdsub_id);
-  if(!pes) demuxer->synced=1; // hack!
+  
+  // try to pre-detect PES:
+  tmp=stream_read_dword(demuxer->stream);
+  if(tmp==0x1E0 || tmp==0x1C0){
+      tmp=stream_read_word(demuxer->stream);
+      if(tmp>1 && tmp<=2048) pes=0; // demuxer->synced=3; // PES...
+  }
+  stream_seek(demuxer->stream,0);
+  
+  if(!pes) demuxer->synced=3; // hack!
+
   num_elementary_packets100=0;
   num_elementary_packets101=0;
   num_elementary_packets1B6=0;




More information about the MPlayer-cvslog mailing list