Remove duplicated stuff from seek_unlocked(); tweak some ordering.
authorCarl Hetherington <cth@carlh.net>
Wed, 8 Aug 2018 23:01:49 +0000 (00:01 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 9 Aug 2018 21:31:11 +0000 (22:31 +0100)
src/lib/butler.cc

index 45cd5a9..882d8bf 100644 (file)
@@ -225,6 +225,10 @@ Butler::seek_unlocked (DCPTime position, bool accurate)
                return;
        }
 
+       _finished = false;
+       _pending_seek_position = position;
+       _pending_seek_accurate = accurate;
+
        {
                boost::mutex::scoped_lock lm (_buffers_mutex);
                _video.clear ();
@@ -232,9 +236,6 @@ Butler::seek_unlocked (DCPTime position, bool accurate)
                _closed_caption.clear ();
        }
 
-       _finished = false;
-       _pending_seek_position = position;
-       _pending_seek_accurate = accurate;
        _summon.notify_all ();
 }
 
@@ -326,16 +327,6 @@ Butler::player_changed ()
                seek_to = next;
        }
 
-       {
-               boost::mutex::scoped_lock lm (_buffers_mutex);
-               _video.clear ();
-               _audio.clear ();
-               _closed_caption.clear ();
-       }
-
-       _finished = false;
-       _summon.notify_all ();
-
        seek_unlocked (seek_to, true);
        _awaiting = seek_to;
 }