Fix bad A/V sync in some (and maybe lots) of circumstances.
authorCarl Hetherington <cth@carlh.net>
Tue, 21 Jan 2014 22:47:02 +0000 (22:47 +0000)
committerCarl Hetherington <cth@carlh.net>
Tue, 21 Jan 2014 22:47:02 +0000 (22:47 +0000)
ChangeLog
src/lib/ffmpeg_decoder.cc

index d94bb7531214d5bf525ed285883e1608da600245..e15643a5e585b762465e0a53ee1a7cf1dfe101ac 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-01-21  Carl Hetherington  <cth@carlh.net>
+
+       * Potentially major fix for bad A/V sync.
+
 2014-01-19  Carl Hetherington  <cth@carlh.net>
 
        * Version 1.63.4 released.
index b95570f5cda2c7032ecd4106451203e31d803bc4..c3709166e6c8c1bb7c33d4a2c902ff436db0c15f 100644 (file)
@@ -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) {