Use atomic for _ignore_text.
[dcpomatic.git] / src / lib / player.cc
index de9be2b71b43686e8eb0fd261a3eac181b44e329..05e47b149d1a463847801d5376c48a657c8b1930 100644 (file)
@@ -99,6 +99,9 @@ int const PlayerProperty::PLAYBACK_LENGTH = 705;
 Player::Player (shared_ptr<const Film> film, Image::Alignment subtitle_alignment)
        : _film (film)
        , _suspended (0)
+       , _ignore_video(false)
+       , _ignore_audio(false)
+       , _ignore_text(false)
        , _tolerant (film->tolerant())
        , _audio_merger (_film->audio_frame_rate())
        , _subtitle_alignment (subtitle_alignment)
@@ -111,6 +114,9 @@ Player::Player (shared_ptr<const Film> film, shared_ptr<const Playlist> playlist
        : _film (film)
        , _playlist (playlist_)
        , _suspended (0)
+       , _ignore_video(false)
+       , _ignore_audio(false)
+       , _ignore_text(false)
        , _tolerant (film->tolerant())
        , _audio_merger (_film->audio_frame_rate())
 {
@@ -498,27 +504,24 @@ Player::get_subtitle_fonts ()
 void
 Player::set_ignore_video ()
 {
-       boost::mutex::scoped_lock lm (_mutex);
        _ignore_video = true;
-       setup_pieces_unlocked ();
+       setup_pieces();
 }
 
 
 void
 Player::set_ignore_audio ()
 {
-       boost::mutex::scoped_lock lm (_mutex);
        _ignore_audio = true;
-       setup_pieces_unlocked ();
+       setup_pieces();
 }
 
 
 void
 Player::set_ignore_text ()
 {
-       boost::mutex::scoped_lock lm (_mutex);
        _ignore_text = true;
-       setup_pieces_unlocked ();
+       setup_pieces();
 }
 
 
@@ -778,7 +781,7 @@ Player::pass ()
                );
 
        if (latest_last_push_end != _stream_states.end()) {
-               LOG_DEBUG_PLAYER("Leading stream is in %1 at %2", latest_last_push_end->second.piece->content->path(0), to_string(latest_last_push_end->second.last_push_end));
+               LOG_DEBUG_PLAYER("Leading audio stream is in %1 at %2", latest_last_push_end->second.piece->content->path(0), to_string(latest_last_push_end->second.last_push_end));
        }
 
        /* Now make a list of those streams that are less than ignore_streams_behind behind the leader */