summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2011-10-23 03:22:32 +0300
committerUoti Urpala <uau@mplayer2.org>2011-10-23 03:29:42 +0300
commit07b7503200095d33f66197f58a86af37a89764cd (patch)
tree21b89a08b71d23eea03a7fb8b080d567f0f21f7b
parent3dd8b7326c242c443e9397bc4008667293fe1a6d (diff)
downloadmpv-07b7503200095d33f66197f58a86af37a89764cd.tar.bz2
mpv-07b7503200095d33f66197f58a86af37a89764cd.tar.xz
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.
-rw-r--r--libmpdemux/demux_demuxers.c2
1 files changed, 1 insertions, 1 deletions
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;