Clear _video/_audio when the seek is request, not when it's performed.
authorCarl Hetherington <cth@carlh.net>
Fri, 5 May 2017 08:57:48 +0000 (09:57 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 5 May 2017 08:57:48 +0000 (09:57 +0100)
Otherwise between the seek request and action there can be a
get_video() call which returns "stale" data.

src/lib/butler.cc

index 48e3a526c896ea160048d366a9b1d3985bba1f0d..29f16833595286b0207a6b1628dd5b16928ec3e0 100644 (file)
@@ -90,8 +90,6 @@ try
 
                /* Do any seek that has been requested */
                if (_pending_seek_position) {
-                       _video.clear ();
-                       _audio.clear ();
                        _finished = false;
                        _player->seek (*_pending_seek_position, _pending_seek_accurate);
                        _pending_seek_position = optional<DCPTime> ();
@@ -152,6 +150,8 @@ Butler::seek (DCPTime position, bool accurate)
                return;
        }
 
+       _video.clear ();
+       _audio.clear ();
        _pending_seek_position = position;
        _pending_seek_accurate = accurate;
        _summon.notify_all ();