pass_texts (_next, picture_asset->size());
if ((_mono_reader || _stereo_reader) && (_decode_referenced || !_dcp_content->reference_video())) {
- int64_t const entry_point = (*_reel)->main_picture()->entry_point ();
+ int64_t const entry_point = (*_reel)->main_picture()->entry_point().get_value_or(0);
if (_mono_reader) {
video->emit (
film(),
}
if (_sound_reader && (_decode_referenced || !_dcp_content->reference_audio())) {
- int64_t const entry_point = (*_reel)->main_sound()->entry_point ();
+ int64_t const entry_point = (*_reel)->main_sound()->entry_point().get_value_or(0);
shared_ptr<const dcp::SoundFrame> sf = _sound_reader->get_frame (entry_point + frame);
uint8_t const * from = sf->data ();
next,
(*_reel)->main_subtitle()->asset(),
_dcp_content->reference_text(TEXT_OPEN_SUBTITLE),
- (*_reel)->main_subtitle()->entry_point(),
+ (*_reel)->main_subtitle()->entry_point().get_value_or(0),
*decoder,
size
);
BOOST_FOREACH (shared_ptr<dcp::ReelClosedCaptionAsset> i, (*_reel)->closed_captions()) {
DCPOMATIC_ASSERT (decoder != text.end ());
pass_texts (
- next, i->asset(), _dcp_content->reference_text(TEXT_CLOSED_CAPTION), i->entry_point(), *decoder, size
+ next, i->asset(), _dcp_content->reference_text(TEXT_CLOSED_CAPTION), i->entry_point().get_value_or(0), *decoder, size
);
++decoder;
}
void
DCPDecoder::next_reel ()
{
- _offset += (*_reel)->main_picture()->duration();
+ _offset += (*_reel)->main_picture()->actual_duration();
++_reel;
get_readers ();
}
/* Seek to pre-roll position */
- while (_reel != _reels.end() && pre >= ContentTime::from_frames ((*_reel)->main_picture()->duration(), _dcp_content->active_video_frame_rate(film()))) {
- ContentTime rd = ContentTime::from_frames ((*_reel)->main_picture()->duration(), _dcp_content->active_video_frame_rate(film()));
+ while (
+ _reel != _reels.end() &&
+ pre >= ContentTime::from_frames ((*_reel)->main_picture()->actual_duration(), _dcp_content->active_video_frame_rate(film()))
+ ) {
+
+ ContentTime rd = ContentTime::from_frames ((*_reel)->main_picture()->actual_duration(), _dcp_content->active_video_frame_rate(film()));
pre -= rd;
t -= rd;
next_reel ();
/* Seek to correct position */
- while (_reel != _reels.end() && t >= ContentTime::from_frames ((*_reel)->main_picture()->duration(), _dcp_content->active_video_frame_rate(film()))) {
- t -= ContentTime::from_frames ((*_reel)->main_picture()->duration(), _dcp_content->active_video_frame_rate(film()));
+ while (
+ _reel != _reels.end() &&
+ t >= ContentTime::from_frames ((*_reel)->main_picture()->actual_duration(), _dcp_content->active_video_frame_rate(film()))
+ ) {
+
+ t -= ContentTime::from_frames ((*_reel)->main_picture()->actual_duration(), _dcp_content->active_video_frame_rate(film()));
next_reel ();
}
}
if (reel_asset) {
- if (reel_asset->duration() != period_duration) {
+ if (reel_asset->actual_duration() != period_duration) {
throw ProgrammingError (
__FILE__, __LINE__,
- String::compose ("%1 vs %2", reel_asset->duration(), period_duration)
+ String::compose ("%1 vs %2", reel_asset->actual_duration(), period_duration)
);
}
reel->add (reel_asset);
if (reel_picture_asset->duration() != period_duration) {
throw ProgrammingError (
__FILE__, __LINE__,
- String::compose ("%1 vs %2", reel_picture_asset->duration(), period_duration)
+ String::compose ("%1 vs %2", reel_picture_asset->actual_duration(), period_duration)
);
}
reel->add (reel_picture_asset);
}
DCPOMATIC_ASSERT (reel_sound_asset);
- if (reel_sound_asset->duration() != period_duration) {
+ if (reel_sound_asset->actual_duration() != period_duration) {
LOG_ERROR (
"Reel sound asset has length %1 but reel period is %2",
- reel_sound_asset->duration(),
+ reel_sound_asset->actual_duration(),
period_duration
);
- if (reel_sound_asset->duration() != period_duration) {
+ if (reel_sound_asset->actual_duration() != period_duration) {
throw ProgrammingError (
__FILE__, __LINE__,
- String::compose ("%1 vs %2", reel_sound_asset->duration(), period_duration)
+ String::compose ("%1 vs %2", reel_sound_asset->actual_duration(), period_duration)
);
}
}
reel->add (reel_sound_asset);
- maybe_add_text<dcp::ReelSubtitleAsset> (_subtitle_asset, reel_picture_asset->duration(), reel, refs, fonts, _film, _period);
+ maybe_add_text<dcp::ReelSubtitleAsset> (_subtitle_asset, reel_picture_asset->actual_duration(), reel, refs, fonts, _film, _period);
for (map<DCPTextTrack, shared_ptr<dcp::SubtitleAsset> >::const_iterator i = _closed_caption_assets.begin(); i != _closed_caption_assets.end(); ++i) {
shared_ptr<dcp::ReelClosedCaptionAsset> a = maybe_add_text<dcp::ReelClosedCaptionAsset> (
- i->second, reel_picture_asset->duration(), reel, refs, fonts, _film, _period
+ i->second, reel_picture_asset->actual_duration(), reel, refs, fonts, _film, _period
);
a->set_annotation_text (i->first.name);
a->set_language (i->first.language);
BOOST_REQUIRE_EQUAL (vf_c.cpls().size(), 1);
BOOST_REQUIRE_EQUAL (vf_c.cpls().front()->reels().size(), 1);
BOOST_REQUIRE (vf_c.cpls().front()->reels().front()->main_picture());
- BOOST_CHECK_EQUAL (vf_c.cpls().front()->reels().front()->main_picture()->entry_point(), 24);
- BOOST_CHECK_EQUAL (vf_c.cpls().front()->reels().front()->main_picture()->duration(), 72);
+ BOOST_CHECK_EQUAL (vf_c.cpls().front()->reels().front()->main_picture()->entry_point().get_value_or(0), 24);
+ BOOST_CHECK_EQUAL (vf_c.cpls().front()->reels().front()->main_picture()->actual_duration(), 72);
BOOST_REQUIRE (vf_c.cpls().front()->reels().front()->main_sound());
- BOOST_CHECK_EQUAL (vf_c.cpls().front()->reels().front()->main_sound()->entry_point(), 24);
- BOOST_CHECK_EQUAL (vf_c.cpls().front()->reels().front()->main_sound()->duration(), 72);
+ BOOST_CHECK_EQUAL (vf_c.cpls().front()->reels().front()->main_sound()->entry_point().get_value_or(0), 24);
+ BOOST_CHECK_EQUAL (vf_c.cpls().front()->reels().front()->main_sound()->actual_duration(), 72);
}
/** Make a OV with video and audio and a VF referencing the OV and adding some more video */