From 862d7d8a1a852fc6bb6dd13ca5db90f83b676579 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 29 Jul 2014 17:55:28 +0200 Subject: 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. --- player/video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'player/video.c') diff --git a/player/video.c b/player/video.c index 40e8e956d3..09fc61fcf0 100644 --- a/player/video.c +++ b/player/video.c @@ -174,7 +174,7 @@ int reinit_video_chain(struct MPContext *mpctx) assert(!(mpctx->initialized_flags & INITIALIZED_VCODEC)); assert(!mpctx->d_video); struct track *track = mpctx->current_track[0][STREAM_VIDEO]; - struct sh_stream *sh = init_demux_stream(mpctx, track); + struct sh_stream *sh = track ? track->stream : NULL; if (!sh) goto no_video; -- cgit v1.2.3