Player::playlist_content_change will call setup_pieces() regardless v2.15.5
authorCarl Hetherington <cth@carlh.net>
Wed, 15 May 2019 22:52:15 +0000 (23:52 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 15 May 2019 22:52:15 +0000 (23:52 +0100)
of the state of frequent, so Butler::player_change must always seek
regardless of the state of frequent.  Otherwise setup_pieces() results
in the next pass() output being at position 0, which causes problems
when the audio from that output is pushed into the audio ring buffers.

src/lib/butler.cc
src/lib/butler.h

index 0218c1fb30d198b494d05b466f778de8509324bf..8c46d51904262aab9f4598032ed344e264a5eb86 100644 (file)
@@ -82,7 +82,7 @@ Butler::Butler (
        /* The butler must hear about things first, otherwise it might not sort out suspensions in time for
           get_video() to be called in response to this signal.
        */
        /* The butler must hear about things first, otherwise it might not sort out suspensions in time for
           get_video() to be called in response to this signal.
        */
-       _player_change_connection = _player->Change.connect (bind (&Butler::player_change, this, _1, _3), boost::signals2::at_front);
+       _player_change_connection = _player->Change.connect (bind (&Butler::player_change, this, _1), boost::signals2::at_front);
        _thread = new boost::thread (bind (&Butler::thread, this));
 #ifdef DCPOMATIC_LINUX
        pthread_setname_np (_thread->native_handle(), "butler");
        _thread = new boost::thread (bind (&Butler::thread, this));
 #ifdef DCPOMATIC_LINUX
        pthread_setname_np (_thread->native_handle(), "butler");
@@ -358,7 +358,7 @@ Butler::memory_used () const
 }
 
 void
 }
 
 void
-Butler::player_change (ChangeType type, bool frequent)
+Butler::player_change (ChangeType type)
 {
        boost::mutex::scoped_lock lm (_mutex);
 
 {
        boost::mutex::scoped_lock lm (_mutex);
 
@@ -366,7 +366,7 @@ Butler::player_change (ChangeType type, bool frequent)
                ++_suspended;
        } else if (type == CHANGE_TYPE_DONE) {
                --_suspended;
                ++_suspended;
        } else if (type == CHANGE_TYPE_DONE) {
                --_suspended;
-               if (_died || _pending_seek_position || frequent) {
+               if (_died || _pending_seek_position) {
                        lm.unlock ();
                        _summon.notify_all ();
                        return;
                        lm.unlock ();
                        _summon.notify_all ();
                        return;
index f1922d3481efedbd418c74e731ae2328d54cee84..09c182f9cf717fb3c53d6371c7dd949add01fe41 100644 (file)
@@ -69,7 +69,7 @@ private:
        void text (PlayerText pt, TextType type, boost::optional<DCPTextTrack> track, dcpomatic::DCPTimePeriod period);
        bool should_run () const;
        void prepare (boost::weak_ptr<PlayerVideo> video);
        void text (PlayerText pt, TextType type, boost::optional<DCPTextTrack> track, dcpomatic::DCPTimePeriod period);
        bool should_run () const;
        void prepare (boost::weak_ptr<PlayerVideo> video);
-       void player_change (ChangeType type, bool frequent);
+       void player_change (ChangeType type);
        void seek_unlocked (dcpomatic::DCPTime position, bool accurate);
 
        boost::shared_ptr<Player> _player;
        void seek_unlocked (dcpomatic::DCPTime position, bool accurate);
 
        boost::shared_ptr<Player> _player;