Don't try to send KDM email unless we have a from address.
[dcpomatic.git] / src / lib / player.cc
index b3f11c8000a62c086fa686d84868f5822b0ef7d1..c6803b0549383393274acf080cf452057d2d02dd 100644 (file)
@@ -345,7 +345,7 @@ Player::set_video_container_size (dcp::Size s)
        _video_container_size = s;
 
        {
-               boost::mutex::scoped_lock lm (_mutex);
+               boost::mutex::scoped_lock lm(_black_image_mutex);
                _black_image = make_shared<Image>(AV_PIX_FMT_RGB24, _video_container_size, Image::Alignment::PADDED);
                _black_image->make_black ();
        }
@@ -399,6 +399,8 @@ Player::film_change (ChangeType type, Film::Property p)
 shared_ptr<PlayerVideo>
 Player::black_player_video_frame (Eyes eyes) const
 {
+       boost::mutex::scoped_lock lm(_black_image_mutex);
+
        return std::make_shared<PlayerVideo> (
                std::make_shared<const RawImageProxy>(_black_image),
                Crop(),
@@ -557,7 +559,7 @@ Player::pass ()
                return false;
        }
 
-       if (_playback_length == DCPTime()) {
+       if (_playback_length.load() == DCPTime()) {
                /* Special; just give one black frame */
                emit_video (black_player_video_frame(Eyes::BOTH), DCPTime());
                return true;
@@ -695,7 +697,7 @@ Player::pass ()
                }
        }
 
-       auto pull_to = _playback_length;
+       auto pull_to = _playback_length.load();
        for (auto const& i: alive_stream_states) {
                if (!i.second.piece->done && i.second.last_push_end < pull_to) {
                        pull_to = i.second.last_push_end;