diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-09-10 15:43:18 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-09-10 23:20:57 +0200 |
| commit | 167b5edb8a1760a8532b2973cd7cca70333249f1 (patch) | |
| tree | 13dff47105a3df182772611e91fffbc6a3ae3b0d /src/lib | |
| parent | de522946acfd022b5084434fbcfd225499a17293 (diff) | |
Use atomic for _play_referenced.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/player.cc | 5 | ||||
| -rw-r--r-- | src/lib/player.h | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc index 6361d7b2a..af963d50d 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -105,6 +105,7 @@ Player::Player (shared_ptr<const Film> film, Image::Alignment subtitle_alignment , _always_burn_open_subtitles(false) , _fast(false) , _tolerant (film->tolerant()) + , _play_referenced(false) , _audio_merger (_film->audio_frame_rate()) , _subtitle_alignment (subtitle_alignment) { @@ -122,6 +123,7 @@ Player::Player (shared_ptr<const Film> film, shared_ptr<const Playlist> playlist , _always_burn_open_subtitles(false) , _fast(false) , _tolerant (film->tolerant()) + , _play_referenced(false) , _audio_merger (_film->audio_frame_rate()) { construct (); @@ -549,9 +551,8 @@ Player::set_fast () void Player::set_play_referenced () { - boost::mutex::scoped_lock lm (_mutex); _play_referenced = true; - setup_pieces_unlocked (); + setup_pieces(); } diff --git a/src/lib/player.h b/src/lib/player.h index d16666bc5..511a579a0 100644 --- a/src/lib/player.h +++ b/src/lib/player.h @@ -188,7 +188,7 @@ private: /** true if we should keep going in the face of `survivable' errors */ bool const _tolerant; /** true if we should `play' (i.e output) referenced DCP data (e.g. for preview) */ - bool _play_referenced = false; + boost::atomic<bool> _play_referenced; /** Time of the next video that we will emit, or the time of the last accurate seek */ boost::optional<dcpomatic::DCPTime> _next_video_time; |
