Use atomic for _fast.
authorCarl Hetherington <cth@carlh.net>
Sat, 10 Sep 2022 13:41:14 +0000 (15:41 +0200)
committerCarl Hetherington <cth@carlh.net>
Sat, 10 Sep 2022 21:20:54 +0000 (23:20 +0200)
src/lib/player.cc
src/lib/player.h

index eb92bbab1a390ac6defc17f3c16654ad0b6fd292..6361d7b2acc1f3d0d6fb523d15d72107f9449a9f 100644 (file)
@@ -103,6 +103,7 @@ Player::Player (shared_ptr<const Film> 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<const Film> film, shared_ptr<const Playlist> 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();
 }
 
 
index bbc49c7380cffb91a8e69e985dfb8f20478ef31d..d16666bc51a4394bd92f49c7cd4fc442f6eca118 100644 (file)
@@ -184,7 +184,7 @@ private:
        boost::atomic<bool> _ignore_text;
        boost::atomic<bool> _always_burn_open_subtitles;
        /** true if we should try to be fast rather than high quality */
-       bool _fast = false;
+       boost::atomic<bool> _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) */