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

index ae76db5c471ed301ef60b2201e2bfce9f91b8d86..05e47b149d1a463847801d5376c48a657c8b1930 100644 (file)
@@ -101,6 +101,7 @@ Player::Player (shared_ptr<const Film> film, Image::Alignment subtitle_alignment
        , _suspended (0)
        , _ignore_video(false)
        , _ignore_audio(false)
+       , _ignore_text(false)
        , _tolerant (film->tolerant())
        , _audio_merger (_film->audio_frame_rate())
        , _subtitle_alignment (subtitle_alignment)
@@ -115,6 +116,7 @@ Player::Player (shared_ptr<const Film> film, shared_ptr<const Playlist> playlist
        , _suspended (0)
        , _ignore_video(false)
        , _ignore_audio(false)
+       , _ignore_text(false)
        , _tolerant (film->tolerant())
        , _audio_merger (_film->audio_frame_rate())
 {
@@ -518,9 +520,8 @@ Player::set_ignore_audio ()
 void
 Player::set_ignore_text ()
 {
-       boost::mutex::scoped_lock lm (_mutex);
        _ignore_text = true;
-       setup_pieces_unlocked ();
+       setup_pieces();
 }
 
 
index 03b7ffebd2ad5b48c824194e5175cea074dfacf5..18be9d40c8b025770711bac4c4d5737945a75f7b 100644 (file)
@@ -181,7 +181,7 @@ private:
        boost::atomic<bool> _ignore_video;
        boost::atomic<bool> _ignore_audio;
        /** true if the player should ignore all text; i.e. never produce any */
-       bool _ignore_text = false;
+       boost::atomic<bool> _ignore_text;
        bool _always_burn_open_subtitles = false;
        /** true if we should try to be fast rather than high quality */
        bool _fast = false;