summaryrefslogtreecommitdiffstats
path: root/player/audio.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-29 17:55:28 +0200
committerwm4 <wm4@nowhere>2014-07-29 17:55:28 +0200
commit862d7d8a1a852fc6bb6dd13ca5db90f83b676579 (patch)
tree1872938f935623b207cc9fd03ac3fa2e33176d41 /player/audio.c
parent6d15c491b063736d6915e74a9134d1cabde9a663 (diff)
downloadmpv-862d7d8a1a852fc6bb6dd13ca5db90f83b676579.tar.bz2
mpv-862d7d8a1a852fc6bb6dd13ca5db90f83b676579.tar.xz
player: fix desync when seeking and switching external tracks
If you for example use --audio-file, disable the external track, seek, and enable the external track again, the playback position of the external file was off, and you would get major A/V desync. This was actually supposed to work, but broke at some time ago (probably commit 2b87415f). It didn't work, because it attempted to seek the stream if it was already selected, which was always true due to reselect_demux_streams() being called before that. Fix by putting the initial selection and the seek together.
Diffstat (limited to 'player/audio.c')
-rw-r--r--player/audio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/player/audio.c b/player/audio.c
index 3a7d26daa7..ab42573fad 100644
--- a/player/audio.c
+++ b/player/audio.c
@@ -96,7 +96,7 @@ void reinit_audio_chain(struct MPContext *mpctx)
{
struct MPOpts *opts = mpctx->opts;
struct track *track = mpctx->current_track[0][STREAM_AUDIO];
- struct sh_stream *sh = init_demux_stream(mpctx, track);
+ struct sh_stream *sh = track ? track->stream : NULL;
if (!sh) {
uninit_player(mpctx, INITIALIZED_AO);
goto no_audio;