[Mplayer-cvslog] CVS: main/libmpdemux demux_ogg.c,1.22,1.23

Moritz Bunkus CVS mosu at mplayerhq.hu
Mon Dec 30 09:59:49 CET 2002


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

Modified Files:
	demux_ogg.c 
Log Message:
bunkus: Fixed Ogg/Ogm seeking by discarding the first packet after the seek which may be incomplete

Index: demux_ogg.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_ogg.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- demux_ogg.c	28 Dec 2002 15:19:41 -0000	1.22
+++ demux_ogg.c	30 Dec 2002 08:59:33 -0000	1.23
@@ -901,7 +901,7 @@
   sh_audio_t* sh_audio = demuxer->audio->sh;
   ogg_packet op;
   float rate;
-  int i,sp;
+  int i,sp,first;
   vorbis_info* vi = NULL;
   int64_t gp = 0;
   off_t pos;
@@ -961,6 +961,7 @@
   ogg_d->pos = pos;
   ogg_d->last_size = 0;
 
+  first = 1;
   while(1) {
     int np;
     ogg_d->pos += ogg_d->last_size;
@@ -992,7 +993,13 @@
 	continue;
       else if(np == 0)
 	break;
-
+      if (first) { /* Discard the first packet as it's probably broken,
+           and we don't have any other means to decide whether it is
+           complete or not. */
+        first = 0;
+        break;
+      }
+      
       if( ((*op.packet & PACKET_IS_SYNCPOINT)  || os->vorbis )  &&
 	  (!ogg_d->syncpoints || op.granulepos >= gp) ) {
 	demux_ogg_add_packet(ds,os,&op);




More information about the MPlayer-cvslog mailing list