[MPlayer-dev-eng] [PATCH] demux_ogg -audiofile fix (bug #375)
Reimar Döffinger
Reimar.Doeffinger at stud.uni-karlsruhe.de
Sun Oct 30 12:05:23 CET 2005
Index: libmpdemux/demux_ogg.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_ogg.c,v
retrieving revision 1.80
diff -u -r1.80 demux_ogg.c
--- libmpdemux/demux_ogg.c 13 Oct 2005 18:33:56 -0000 1.80
+++ libmpdemux/demux_ogg.c 30 Oct 2005 11:04:50 -0000
@@ -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)) {
@@ -1390,8 +1388,6 @@
}
-extern void resync_audio_stream(sh_audio_t *sh_audio);
-
static void demux_ogg_seek(demuxer_t *demuxer,float rel_seek_secs,int flags) {
ogg_demuxer_t* ogg_d = demuxer->priv;
ogg_sync_state* sync = &ogg_d->sync;
@@ -1473,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) {
@@ -1502,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;
@@ -1558,8 +1555,8 @@
vo_osd_changed(OSDTYPE_SUBTITLE);
clear_sub = -1;
demux_ogg_add_packet(ds,os,ds->id,&op);
- if(sh_audio)
- resync_audio_stream(sh_audio);
+ if (demuxer->video->id < 0)
+ sh_audio->delay = pts;
return;
}
}
More information about the MPlayer-dev-eng
mailing list