diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-09-10 15:34:14 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-09-10 23:20:48 +0200 |
| commit | d3251244d0794414001eef5beafa22b67d650863 (patch) | |
| tree | bbb00b41c500e140f25e638b2f67115321c00791 | |
| parent | 7b4d4a6c2bc3f5a0f9216fdb8d96bbe952aa49ee (diff) | |
Use atomic for _ignore_audio.
| -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 c04a43369..ae76db5c4 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -100,6 +100,7 @@ Player::Player (shared_ptr<const Film> film, Image::Alignment subtitle_alignment : _film (film) , _suspended (0) , _ignore_video(false) + , _ignore_audio(false) , _tolerant (film->tolerant()) , _audio_merger (_film->audio_frame_rate()) , _subtitle_alignment (subtitle_alignment) @@ -113,6 +114,7 @@ Player::Player (shared_ptr<const Film> film, shared_ptr<const Playlist> playlist , _playlist (playlist_) , _suspended (0) , _ignore_video(false) + , _ignore_audio(false) , _tolerant (film->tolerant()) , _audio_merger (_film->audio_frame_rate()) { @@ -508,9 +510,8 @@ Player::set_ignore_video () void Player::set_ignore_audio () { - boost::mutex::scoped_lock lm (_mutex); _ignore_audio = true; - setup_pieces_unlocked (); + setup_pieces(); } diff --git a/src/lib/player.h b/src/lib/player.h index c65ec40fe..03b7ffebd 100644 --- a/src/lib/player.h +++ b/src/lib/player.h @@ -179,7 +179,7 @@ private: /** true if the player should ignore all video; i.e. never produce any */ boost::atomic<bool> _ignore_video; - bool _ignore_audio = false; + boost::atomic<bool> _ignore_audio; /** true if the player should ignore all text; i.e. never produce any */ bool _ignore_text = false; bool _always_burn_open_subtitles = false; |
