[MPlayer-cvslog] CVS: main/libmpdemux demux_ogg.c,1.81,1.82

Reimar Döffinger CVS syncmail at mplayerhq.hu
Tue Nov 1 17:12:56 CET 2005


CVS change done by Reimar Döffinger CVS

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv22550/libmpdemux

Modified Files:
	demux_ogg.c 
Log Message:
Fix two (loosely) related bugs: massive A-V desync with -audiofile (bugzilla
bug #375, sh_audio->delay must only be set when seeking, not at every packet)
and not switching to the next file when seeking hits eof.


Index: demux_ogg.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_ogg.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -r1.81 -r1.82
--- demux_ogg.c	30 Oct 2005 09:19:05 -0000	1.81
+++ demux_ogg.c	1 Nov 2005 16:12:53 -0000	1.82
@@ -554,8 +554,6 @@
   if (ds == d->video && ((sh_audio_t*)ds->sh)->format == FOURCC_THEORA)
      context = ((sh_video_t *)ds->sh)->context;
   data = demux_ogg_read_packet(os,pack,context,&pts,&flags,samplesize);
-  if(d->video->id < 0)
-      ((sh_audio_t*)ds->sh)->delay = pts;
 
   /// Clear subtitles if necessary (for broken files)
   if ((clear_sub > 0) && (pts >= clear_sub)) {
@@ -1471,7 +1469,8 @@
     }
   }
     if (pos < 0) pos = 0;
-    if (pos > (demuxer->movi_end - demuxer->movi_start)) return;
+    if (pos > (demuxer->movi_end - demuxer->movi_start))
+      pos = demuxer->movi_end - demuxer->movi_start;
   } // if(ogg_d->syncpoints)
 
   while(1) {
@@ -1500,8 +1499,8 @@
       char* buf = ogg_sync_buffer(sync,BLOCK_SIZE);
       int len = stream_read(demuxer->stream,buf,BLOCK_SIZE);
        if(len == 0 && demuxer->stream->eof) {
-	mp_msg(MSGT_DEMUX,MSGL_ERR,"EOF while trying to seek !!!!\n");
-	break;
+	mp_msg(MSGT_DEMUX,MSGL_V,"EOF while trying to seek !!!!\n");
+	return;
       }
       ogg_sync_wrote(sync,len);
       continue;
@@ -1556,6 +1555,8 @@
         vo_osd_changed(OSDTYPE_SUBTITLE);
         clear_sub = -1;
 	demux_ogg_add_packet(ds,os,ds->id,&op);
+        if (demuxer->video->id < 0)
+          sh_audio->delay = pts;
 	return;
       }
      }




More information about the MPlayer-cvslog mailing list