{
Change (ChangeType::PENDING, PlayerProperty::DCP_DECODE_REDUCTION, false);
- {
- boost::mutex::scoped_lock lm (_mutex);
-
- if (reduction == _dcp_decode_reduction) {
- lm.unlock ();
- Change (ChangeType::CANCELLED, PlayerProperty::DCP_DECODE_REDUCTION, false);
- return;
- }
-
- _dcp_decode_reduction = reduction;
- setup_pieces_unlocked ();
+ if (reduction == _dcp_decode_reduction.load()) {
+ Change(ChangeType::CANCELLED, PlayerProperty::DCP_DECODE_REDUCTION, false);
+ return;
}
+ _dcp_decode_reduction = reduction;
+ setup_pieces();
+
Change (ChangeType::DONE, PlayerProperty::DCP_DECODE_REDUCTION, false);
}
/** Time of the next audio that we will emit, or the time of the last accurate seek */
boost::optional<dcpomatic::DCPTime> _next_audio_time;
- boost::optional<int> _dcp_decode_reduction;
+ boost::atomic<boost::optional<int>> _dcp_decode_reduction;
typedef std::map<std::weak_ptr<Piece>, std::shared_ptr<PlayerVideo>, std::owner_less<std::weak_ptr<Piece>>> LastVideoMap;
LastVideoMap _last_video;