diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-08-02 23:22:49 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-08-02 23:22:49 +0100 |
| commit | 4fe1a062eb31d680b8b4ac0191b9e2fc2d6aaec3 (patch) | |
| tree | d86a1f778545f238e0b226a80419c066033b4d6e /src/lib/butler.h | |
| parent | e82a4c81fe8bb3c3c6b68c667bda2f32fed4e68d (diff) | |
A variety of changes to improve (but not entirely fix) behaviour
when moving content (or otherwise changing the playlist) while playing.
This commit refills the butler when things change in certain ways,
and improves locking to cope with Player methods being called from
the GUI and butler threads at the same time.
Diffstat (limited to 'src/lib/butler.h')
| -rw-r--r-- | src/lib/butler.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/butler.h b/src/lib/butler.h index a61011f40..a8b38ef2e 100644 --- a/src/lib/butler.h +++ b/src/lib/butler.h @@ -53,11 +53,17 @@ private: void audio (boost::shared_ptr<AudioBuffers> audio); bool should_run () const; void prepare (boost::weak_ptr<PlayerVideo> video) const; + void player_changed (int); + void seek_unlocked (DCPTime position, bool accurate); boost::shared_ptr<Player> _player; boost::shared_ptr<Log> _log; boost::thread* _thread; + /** mutex to protect _video and _audio for when we are clearing them and they both need to be + cleared together without any data being inserted in the interim. + */ + boost::mutex _video_audio_mutex; VideoRingBuffers _video; AudioRingBuffers _audio; @@ -80,6 +86,12 @@ private: bool _disable_audio; + /** If we are waiting to be refilled following a seek, this is the time we were + seeking to. + */ + boost::optional<DCPTime> _awaiting; + boost::signals2::scoped_connection _player_video_connection; boost::signals2::scoped_connection _player_audio_connection; + boost::signals2::scoped_connection _player_changed_connection; }; |
