[Mplayer-cvslog] CVS: main demux_mpg.c,1.12,1.13

GEREOFFY arpi_esp at users.sourceforge.net
Fri Apr 20 18:43:19 CEST 2001


Update of /cvsroot/mplayer/main
In directory usw-pr-cvs1:/tmp/cvs-serv7043

Modified Files:
	demux_mpg.c 
Log Message:
small bugfix in the new optimized head sync code

Index: demux_mpg.c
===================================================================
RCS file: /cvsroot/mplayer/main/demux_mpg.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** demux_mpg.c	2001/04/20 14:32:09	1.12
--- demux_mpg.c	2001/04/20 16:43:17	1.13
***************
*** 4,7 ****
--- 4,9 ----
  #define MAX_PS_PACKETSIZE (224*1024)
  
+ static int mpeg_pts_error=0;
+ 
  static unsigned int read_mpeg_timestamp(stream_t *s,int c){
    int d,e;
***************
*** 9,13 ****
    d=stream_read_word(s);
    e=stream_read_word(s);
!   if( ((c&1)!=1) || ((d&1)!=1) || ((e&1)!=1) ) return 0; // invalid pts
    pts=(((c>>1)&7)<<30)|((d>>1)<<15)|(e>>1);
    if(verbose>=3) printf("{%d}",pts);
--- 11,18 ----
    d=stream_read_word(s);
    e=stream_read_word(s);
!   if( ((c&1)!=1) || ((d&1)!=1) || ((e&1)!=1) ){
!     ++mpeg_pts_error;
!     return 0; // invalid pts
!   }
    pts=(((c>>1)&7)<<30)|((d>>1)<<15)|(e>>1);
    if(verbose>=3) printf("{%d}",pts);
***************
*** 50,53 ****
--- 55,60 ----
    }
  
+   mpeg_pts_error=0;
+ 
    while(len>0){   // Skip stuFFing bytes
      c=stream_read_char(demux->stream);--len;
***************
*** 147,150 ****
--- 154,158 ----
      }
    }
+   if(mpeg_pts_error) printf("  {PTS_err:%d}  \n",mpeg_pts_error);
    if(verbose>=3) printf(" => len=%d\n",len);
  
***************
*** 216,221 ****
    demux->filepos=stream_tell(demux->stream);
    head=stream_read_dword(demux->stream);
!   demux->filepos-=skipped;
!   while(1){
      int c=stream_read_char(demux->stream);
      if(c<0) break; //EOF
--- 224,231 ----
    demux->filepos=stream_tell(demux->stream);
    head=stream_read_dword(demux->stream);
!   if((head&0xFFFFFF00)!=0x100){
!    // sync...
!    demux->filepos-=skipped;
!    while(1){
      int c=stream_read_char(demux->stream);
      if(c<0) break; //EOF
***************
*** 228,233 ****
      head|=c;
      break;
    }
-   demux->filepos+=skipped;
    if(stream_eof(demux->stream)) break;
    // sure: head=0x000001XX
--- 238,244 ----
      head|=c;
      break;
+    }
+    demux->filepos+=skipped;
    }
    if(stream_eof(demux->stream)) break;
    // sure: head=0x000001XX


_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog



More information about the MPlayer-cvslog mailing list