[Mplayer-cvslog] CVS: main demux_mpg.c,1.8,1.9

GEREOFFY arpi_esp at users.sourceforge.net
Fri Apr 20 01:50:10 CEST 2001


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

Modified Files:
	demux_mpg.c 
Log Message:
PES vs. VOB problem... yet another solution

Index: demux_mpg.c
===================================================================
RCS file: /cvsroot/mplayer/main/demux_mpg.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** demux_mpg.c	2001/04/19 19:43:18	1.8
--- demux_mpg.c	2001/04/19 23:50:08	1.9
***************
*** 31,38 ****
    if(verbose>=3) printf("demux_read_packet: %X\n",id);
  
!   if(id==0x1F0){
!     demux->synced=0; // force resync after 0x1F0
!     return -1;
!   }
  
  //  if(id==0x1BA) packet_start_pos=stream_tell(demux->stream);
--- 31,38 ----
    if(verbose>=3) printf("demux_read_packet: %X\n",id);
  
! //  if(id==0x1F0){
! //    demux->synced=0; // force resync after 0x1F0
! //    return -1;
! //}
  
  //  if(id==0x1BA) packet_start_pos=stream_tell(demux->stream);
***************
*** 43,47 ****
    len=stream_read_word(demux->stream);
    if(verbose>=3)  printf("PACKET len=%d",len);
!   if(len==62480){ demux->synced=0;return -1;} /* :) */
  //  if(len==0 || len>MAX_PS_PACKETSIZE) return -2;  // invalid packet !!!!!!
    if(len==0 || len>MAX_PS_PACKETSIZE){
--- 43,47 ----
    len=stream_read_word(demux->stream);
    if(verbose>=3)  printf("PACKET len=%d",len);
! //  if(len==62480){ demux->synced=0;return -1;} /* :) */
  //  if(len==0 || len>MAX_PS_PACKETSIZE) return -2;  // invalid packet !!!!!!
    if(len==0 || len>MAX_PS_PACKETSIZE){
***************
*** 113,122 ****
  
        if(demux->audio->id==aid){
          ds=demux->audio;
          if(!ds->sh) ds->sh=avi_header.a_streams[aid];
          // READ Packet: Skip additional audio header data:
!         c=stream_read_char(demux->stream);
!         c=stream_read_char(demux->stream);
!         c=stream_read_char(demux->stream);
          len-=3;
          if(ds->type==-1){
--- 113,124 ----
  
        if(demux->audio->id==aid){
+ //        int type;
          ds=demux->audio;
          if(!ds->sh) ds->sh=avi_header.a_streams[aid];
          // READ Packet: Skip additional audio header data:
!         c=stream_read_char(demux->stream);//type=c;
!         c=stream_read_char(demux->stream);//type|=c<<8;
!         c=stream_read_char(demux->stream);//type|=c<<16;
! //        printf("[%06X]",type);
          len-=3;
          if(ds->type==-1){
***************
*** 140,144 ****
  
    } else {
!     //if(c!=0x0f) printf("  {ERROR5,c=%d}  \n",c);
    }
    if(verbose>=3) printf(" => len=%d\n",len);
--- 142,147 ----
  
    } else {
!     if(c!=0x0f) printf("  {ERROR5,c=%d}  \n",c);
!     return -1;  // invalid packet !!!!!!
    }
    if(verbose>=3) printf(" => len=%d\n",len);
***************
*** 182,186 ****
    }
    if(verbose>=2) printf("DEMUX_MPG: Skipping %d data bytes from packet %04X\n",len,id);
!   stream_skip(demux->stream,len);
    return 0;
  }
--- 185,189 ----
    }
    if(verbose>=2) printf("DEMUX_MPG: Skipping %d data bytes from packet %04X\n",len,id);
!   if(len<=2356) stream_skip(demux->stream,len);
    return 0;
  }
***************
*** 208,216 ****
    demux->filepos=stream_tell(demux->stream);
    head=stream_read_dword(demux->stream);
!   while((head&0xffffff00)!=0x00000100){
!     if(stream_eof(demux->stream)) break;
!     head=(head<<8)|stream_read_char(demux->stream);
!     ++skipped; ++demux->filepos;
    }
    if(stream_eof(demux->stream)) break;
    // sure: head=0x000001XX
--- 211,228 ----
    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
!     head<<=8;
!     if(head!=0x100){
!       head|=c;
!       ++skipped; //++demux->filepos;
!       continue;
!     }
!     head|=c;
!     break;
    }
+   demux->filepos+=skipped;
    if(stream_eof(demux->stream)) break;
    // sure: head=0x000001XX
***************
*** 223,226 ****
--- 235,240 ----
        demux->synced=2;
        if(verbose) printf("system stream synced at 0x%X (%d)!\n",demux->filepos,demux->filepos);
+       num_elementary_packets100=0; // requires for re-sync!
+       num_elementary_packets101=0; // requires for re-sync!
      } else demux->synced=0;
    } // else


_______________________________________________
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