summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-09-10 15:32:24 +0200
committerCarl Hetherington <cth@carlh.net>2022-09-10 23:20:44 +0200
commit7b4d4a6c2bc3f5a0f9216fdb8d96bbe952aa49ee (patch)
treec0f06a295e0d569c042b5d79a04ee55d709159fc /src/lib
parent82c6dfe9f286e07bdaf3434593ce1c9bd0ee2677 (diff)
Use atomic for _ignore_video.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/player.cc5
-rw-r--r--src/lib/player.h2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc
index b7088f1d2..c04a43369 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -99,6 +99,7 @@ int const PlayerProperty::PLAYBACK_LENGTH = 705;
Player::Player (shared_ptr<const Film> film, Image::Alignment subtitle_alignment)
: _film (film)
, _suspended (0)
+ , _ignore_video(false)
, _tolerant (film->tolerant())
, _audio_merger (_film->audio_frame_rate())
, _subtitle_alignment (subtitle_alignment)
@@ -111,6 +112,7 @@ Player::Player (shared_ptr<const Film> film, shared_ptr<const Playlist> playlist
: _film (film)
, _playlist (playlist_)
, _suspended (0)
+ , _ignore_video(false)
, _tolerant (film->tolerant())
, _audio_merger (_film->audio_frame_rate())
{
@@ -498,9 +500,8 @@ Player::get_subtitle_fonts ()
void
Player::set_ignore_video ()
{
- boost::mutex::scoped_lock lm (_mutex);
_ignore_video = true;
- setup_pieces_unlocked ();
+ setup_pieces();
}
diff --git a/src/lib/player.h b/src/lib/player.h
index 71b3cc464..c65ec40fe 100644
--- a/src/lib/player.h
+++ b/src/lib/player.h
@@ -178,7 +178,7 @@ private:
std::shared_ptr<Image> _black_image;
/** true if the player should ignore all video; i.e. never produce any */
- bool _ignore_video = false;
+ boost::atomic<bool> _ignore_video;
bool _ignore_audio = false;
/** true if the player should ignore all text; i.e. never produce any */
bool _ignore_text = false;