diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-08-18 22:49:46 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-08-19 01:29:04 +0100 |
| commit | 9a27d60ea7888d300a5a2414a477091428589b82 (patch) | |
| tree | 42db6de6bf6d420a760e79f93d0ce3ea47423d57 /src/lib/player.cc | |
| parent | 0bd80b641875632b9b2b17530d00e4546bba8088 (diff) | |
Suspend butler on player may-change as otherwise there's a window
between Player::_suspended being set to false and the the butler
requesting a seek, during which the butler may call pass().
Diffstat (limited to 'src/lib/player.cc')
| -rw-r--r-- | src/lib/player.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc index 91f1cb517..df8c47cf9 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -87,7 +87,7 @@ int const PlayerProperty::DCP_DECODE_REDUCTION = 704; Player::Player (shared_ptr<const Film> film, shared_ptr<const Playlist> playlist) : _film (film) , _playlist (playlist) - , _can_run (false) + , _suspended (false) , _ignore_video (false) , _ignore_audio (false) , _ignore_text (false) @@ -220,7 +220,7 @@ Player::setup_pieces_unlocked () _last_video_time = DCPTime (); _last_video_eyes = EYES_BOTH; _last_audio_time = DCPTime (); - _can_run = true; + _suspended = false; } void @@ -232,7 +232,7 @@ Player::playlist_content_may_change () until that has happened and we've rebuilt our pieces. Stop pass() and seek() from working until then. */ - _can_run = false; + _suspended = true; } MayChange (); @@ -295,7 +295,6 @@ void Player::playlist_content_not_changed () { /* A possible content change did end up happening for some reason */ - setup_pieces (); NotChanged (); } @@ -613,7 +612,7 @@ Player::pass () { boost::mutex::scoped_lock lm (_mutex); - if (!_can_run) { + if (_suspended) { /* We can't pass in this state */ return false; } @@ -1039,7 +1038,7 @@ Player::seek (DCPTime time, bool accurate) { boost::mutex::scoped_lock lm (_mutex); - if (!_can_run) { + if (_suspended) { /* We can't seek in this state */ return; } |
