[Mplayer-cvslog] CVS: main/libmpdemux demux_ogg.c,1.24,1.25

Moritz Bunkus CVS mosu at mplayerhq.hu
Sun Jan 5 14:48:16 CET 2003


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

Modified Files:
	demux_ogg.c 
Log Message:
mosu: Fixed OGG/OGM seeking for XCDs in which the OGG/OGM does not start at pos 0 in the stream

Index: demux_ogg.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_ogg.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- demux_ogg.c	4 Jan 2003 22:56:56 -0000	1.24
+++ demux_ogg.c	5 Jan 2003 13:48:13 -0000	1.25
@@ -725,7 +725,7 @@
   if(!s->end_pos)
     demuxer->seekable = 0;
   else {
-    demuxer->movi_start = 0;
+    demuxer->movi_start = s->start_pos; // Needed for XCD (Ogg written in MODE2)
     demuxer->movi_end = s->end_pos;
     demuxer->seekable = 1;
     if(index_mode == 2)
@@ -965,19 +965,18 @@
     pos = ogg_d->syncpoints[sp].page_pos;
 
   } else {
-    pos = flags & 1 ? demuxer->movi_start : ogg_d->pos;
+    pos = flags & 1 ? 0 : ogg_d->pos;
     if(flags & 2)
       pos += (demuxer->movi_end - demuxer->movi_start) * rel_seek_secs;
     else
       pos += rel_seek_secs * ogg_d->pos / (os->lastpos / rate);
-
-    if(pos < demuxer->movi_start)
-      pos = demuxer->movi_start;
-    else if(pos > demuxer->movi_end)
+    if (pos < 0)
+      pos = 0;
+    else if (pos > (demuxer->movi_end - demuxer->movi_start))
       return;
   }
 
-  stream_seek(demuxer->stream,pos);
+  stream_seek(demuxer->stream,pos+demuxer->movi_start);
   ogg_sync_reset(sync);
   for(i = 0 ; i < ogg_d->num_sub ; i++) {
     ogg_stream_reset(&ogg_d->subs[i].stream);



More information about the MPlayer-cvslog mailing list