diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-09-10 15:37:31 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-09-10 23:20:50 +0200 |
| commit | d41c3bb9ebfb450316e6c79fdf0281ac2e155aa1 (patch) | |
| tree | 759a983eed7b1be5c7b8ec51ab29d02b5ca12c9d | |
| parent | d3251244d0794414001eef5beafa22b67d650863 (diff) | |
Use atomic for _ignore_text.
| -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 ae76db5c4..05e47b149 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -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(); } diff --git a/src/lib/player.h b/src/lib/player.h index 03b7ffebd..18be9d40c 100644 --- a/src/lib/player.h +++ b/src/lib/player.h @@ -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; |
