summaryrefslogtreecommitdiff
path: root/src/lib/player.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/player.cc')
-rw-r--r--src/lib/player.cc21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc
index f93327495..cf5429fd5 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -86,6 +86,7 @@ using namespace dcpomatic;
Player::Player(shared_ptr<const Film> film, Image::Alignment subtitle_alignment, bool tolerant)
: _film(film)
, _suspended(0)
+ , _video_container_size(dcp::Size{})
, _ignore_video(false)
, _ignore_audio(false)
, _ignore_text(false)
@@ -94,6 +95,7 @@ Player::Player(shared_ptr<const Film> film, Image::Alignment subtitle_alignment,
, _tolerant(tolerant)
, _play_referenced(false)
, _audio_merger(film->audio_frame_rate())
+ , _playback_length(dcpomatic::DCPTime{})
, _subtitle_alignment(subtitle_alignment)
{
construct();
@@ -104,6 +106,7 @@ Player::Player(shared_ptr<const Film> film, shared_ptr<const Playlist> playlist_
: _film(film)
, _playlist(playlist_)
, _suspended(0)
+ , _video_container_size(dcp::Size{})
, _ignore_video(false)
, _ignore_audio(false)
, _ignore_text(false)
@@ -112,6 +115,7 @@ Player::Player(shared_ptr<const Film> film, shared_ptr<const Playlist> playlist_
, _tolerant(tolerant)
, _play_referenced(false)
, _audio_merger(film->audio_frame_rate())
+ , _playback_length(dcpomatic::DCPTime{})
{
construct();
}
@@ -164,7 +168,7 @@ Player::Player(Player&& other)
, _play_referenced(other._play_referenced.load())
, _next_video_time(other._next_video_time)
, _next_audio_time(other._next_audio_time)
- , _dcp_decode_reduction(other._dcp_decode_reduction.load())
+ , _dcp_decode_reduction(other._dcp_decode_reduction)
, _last_video(std::move(other._last_video))
, _audio_merger(std::move(other._audio_merger))
, _shuffler(std::move(other._shuffler))
@@ -204,7 +208,7 @@ Player::operator=(Player&& other)
_play_referenced = other._play_referenced.load();
_next_video_time = other._next_video_time;
_next_audio_time = other._next_audio_time;
- _dcp_decode_reduction = other._dcp_decode_reduction.load();
+ _dcp_decode_reduction = other._dcp_decode_reduction;
_last_video = std::move(other._last_video);
_audio_merger = std::move(other._audio_merger);
_shuffler = std::move(other._shuffler);
@@ -1554,12 +1558,17 @@ Player::set_dcp_decode_reduction(optional<int> reduction)
{
ChangeSignaller<Player, int> cc(this, PlayerProperty::DCP_DECODE_REDUCTION);
- if (reduction == _dcp_decode_reduction.load()) {
- cc.abort();
- return;
+ {
+ boost::mutex::scoped_lock lm(_mutex);
+
+ if (reduction == _dcp_decode_reduction) {
+ cc.abort();
+ return;
+ }
+
+ _dcp_decode_reduction = reduction;
}
- _dcp_decode_reduction = reduction;
setup_pieces();
}