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

index 05e47b149d1a463847801d5376c48a657c8b1930..eb92bbab1a390ac6defc17f3c16654ad0b6fd292 100644 (file)
@@ -102,6 +102,7 @@ Player::Player (shared_ptr<const Film> film, Image::Alignment subtitle_alignment
        , _ignore_video(false)
        , _ignore_audio(false)
        , _ignore_text(false)
+       , _always_burn_open_subtitles(false)
        , _tolerant (film->tolerant())
        , _audio_merger (_film->audio_frame_rate())
        , _subtitle_alignment (subtitle_alignment)
@@ -117,6 +118,7 @@ Player::Player (shared_ptr<const Film> film, shared_ptr<const Playlist> playlist
        , _ignore_video(false)
        , _ignore_audio(false)
        , _ignore_text(false)
+       , _always_burn_open_subtitles(false)
        , _tolerant (film->tolerant())
        , _audio_merger (_film->audio_frame_rate())
 {
@@ -529,7 +531,6 @@ Player::set_ignore_text ()
 void
 Player::set_always_burn_open_subtitles ()
 {
-       boost::mutex::scoped_lock lm (_mutex);
        _always_burn_open_subtitles = true;
 }
 
index 18be9d40c8b025770711bac4c4d5737945a75f7b..bbc49c7380cffb91a8e69e985dfb8f20478ef31d 100644 (file)
@@ -182,7 +182,7 @@ private:
        boost::atomic<bool> _ignore_audio;
        /** true if the player should ignore all text; i.e. never produce any */
        boost::atomic<bool> _ignore_text;
-       bool _always_burn_open_subtitles = false;
+       boost::atomic<bool> _always_burn_open_subtitles;
        /** true if we should try to be fast rather than high quality */
        bool _fast = false;
        /** true if we should keep going in the face of `survivable' errors */