From de522946acfd022b5084434fbcfd225499a17293 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 10 Sep 2022 15:41:14 +0200 Subject: [PATCH] Use atomic for _fast. --- src/lib/player.cc | 5 +++-- 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 eb92bbab1..6361d7b2a 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -103,6 +103,7 @@ Player::Player (shared_ptr film, Image::Alignment subtitle_alignment , _ignore_audio(false) , _ignore_text(false) , _always_burn_open_subtitles(false) + , _fast(false) , _tolerant (film->tolerant()) , _audio_merger (_film->audio_frame_rate()) , _subtitle_alignment (subtitle_alignment) @@ -119,6 +120,7 @@ Player::Player (shared_ptr film, shared_ptr playlist , _ignore_audio(false) , _ignore_text(false) , _always_burn_open_subtitles(false) + , _fast(false) , _tolerant (film->tolerant()) , _audio_merger (_film->audio_frame_rate()) { @@ -539,9 +541,8 @@ Player::set_always_burn_open_subtitles () void Player::set_fast () { - boost::mutex::scoped_lock lm (_mutex); _fast = true; - setup_pieces_unlocked (); + setup_pieces(); } diff --git a/src/lib/player.h b/src/lib/player.h index bbc49c738..d16666bc5 100644 --- a/src/lib/player.h +++ b/src/lib/player.h @@ -184,7 +184,7 @@ private: boost::atomic _ignore_text; boost::atomic _always_burn_open_subtitles; /** true if we should try to be fast rather than high quality */ - bool _fast = false; + boost::atomic _fast; /** 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) */ -- 2.30.2