From 2e0283e334b77873b2244cef39ac2fb362dd7836 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 21 Jan 2014 22:47:02 +0000 Subject: Fix bad A/V sync in some (and maybe lots) of circumstances. --- src/lib/ffmpeg_decoder.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/lib/ffmpeg_decoder.cc') diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index b95570f5c..c3709166e 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -322,7 +322,16 @@ FFmpegDecoder::seek (VideoContent::Frame frame, bool accurate) avcodec_flush_buffers (_subtitle_codec_context); } - _just_sought = true; + /* This !accurate is piling hack upon hack; setting _just_sought to true + even with accurate == true defeats our attempt to align the start + of the video and audio. Here we disable that defeat when accurate == true + i.e. when we are making a DCP rather than just previewing one. + Ewww. This should be gone in 2.0. + */ + if (!accurate) { + _just_sought = true; + } + _video_position = frame; if (frame == 0 || !accurate) { -- cgit v1.2.3