From 07b7503200095d33f66197f58a86af37a89764cd Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Sun, 23 Oct 2011 03:22:32 +0300 Subject: demux_demuxers: fix seeking bug (--audiofile) Demux_demuxers checked a pts value against 0 to see if it was unset, but other code uses MP_NOPTS_VALUE for that now. As a result audio and subtitle streams could seek to a large negative position (effectively to 0) instead of the correct target position. This broke --audiofile; the --initial-audio-sync code could compensate for wrong demuxer seek up to 5 minutes from the start of the file, masking the bug, but seeking further than that audio would seek to 0 instead. Note that the current --audiofile implementation using the demux_demuxers wrapper is a fundamentally unsound design and still not expected to generally work properly even after fixing this particular problem. --- libmpdemux/demux_demuxers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmpdemux/demux_demuxers.c b/libmpdemux/demux_demuxers.c index 54fe5c1b01..b66bf57bdb 100644 --- a/libmpdemux/demux_demuxers.c +++ b/libmpdemux/demux_demuxers.c @@ -107,7 +107,7 @@ static void demux_demuxers_seek(demuxer_t *demuxer,float rel_seek_secs,float aud demux_seek(priv->vd,rel_seek_secs,audio_delay,flags); // Get the new pos pos = demuxer->video->pts; - if (!pos) { + if (pos == MP_NOPTS_VALUE) { demux_fill_buffer(priv->vd, demuxer->video); if (demuxer->video->first) pos = demuxer->video->first->pts; -- cgit v1.2.3