Nicer fix for previous commit.
authorCarl Hetherington <cth@carlh.net>
Wed, 26 Apr 2017 10:02:46 +0000 (11:02 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 26 Apr 2017 10:02:46 +0000 (11:02 +0100)
src/lib/butler.cc

index 89095613d1eb3db09a8639e208c37f38c33ac947..48e3a526c896ea160048d366a9b1d3985bba1f0d 100644 (file)
@@ -90,6 +90,9 @@ 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> ();
                }
@@ -102,8 +105,7 @@ try
                        lm.unlock ();
                        bool const r = _player->pass ();
                        lm.lock ();
-                       /* We must check _pending_seek_position again here as it may have been set while lm was unlocked */
-                       if (r && !_pending_seek_position) {
+                       if (r) {
                                _finished = true;
                                _arrived.notify_all ();
                                break;
@@ -150,9 +152,6 @@ Butler::seek (DCPTime position, bool accurate)
                return;
        }
 
-       _video.clear ();
-       _audio.clear ();
-       _finished = false;
        _pending_seek_position = position;
        _pending_seek_accurate = accurate;
        _summon.notify_all ();