shared_ptr<DCPDecoder> dcp = dynamic_pointer_cast<DCPDecoder> (decoder);
if (dcp && _play_referenced) {
- dcp->set_decode_referenced ();
+ if (_play_referenced) {
+ dcp->set_decode_referenced ();
+ }
+ dcp->set_forced_reduction (_dcp_decode_reduction);
}
shared_ptr<Piece> piece (new Piece (i, decoder, frc));
}
}
- _black = Empty (_film, bind(&Content::video, _1));
- _silent = Empty (_film, bind(&Content::audio, _1));
+ _black = Empty (_film->content(), _film->length(), bind(&Content::video, _1));
+ _silent = Empty (_film->content(), _film->length(), bind(&Content::audio, _1));
_last_video_time = DCPTime ();
_last_audio_time = DCPTime ();
void
Player::seek (DCPTime time, bool accurate)
{
+ if (!_have_valid_pieces) {
+ setup_pieces ();
+ }
+
if (_audio_processor) {
_audio_processor->flush ();
}
cut->copy_from (audio.get(), remaining_frames, discard_frames, 0);
return make_pair(cut, time + discard_time);
}
+
+void
+Player::set_dcp_decode_reduction (optional<int> reduction)
+{
+ if (reduction == _dcp_decode_reduction) {
+ return;
+ }
+
+ _dcp_decode_reduction = reduction;
+ _have_valid_pieces = false;
+ Changed (false);
+}