1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-23 15:22:09 +00:00

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.
This commit is contained in:
Uoti Urpala 2011-10-23 03:22:32 +03:00
parent 3dd8b7326c
commit 07b7503200

View File

@ -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;