X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Fdcp_decoder.cc;h=9064627ba9cd937a4930631e17f4665837553ee6;hp=e72573ebc085352aa751cd82c4cdc39268f251cf;hb=HEAD;hpb=8408285c72f330158c40f1c6f4c6fa80b39a6f57 diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index e72573ebc..727dcbf26 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -23,6 +23,7 @@ #include "audio_content.h" #include "audio_decoder.h" #include "config.h" +#include "constants.h" #include "dcp_content.h" #include "dcp_decoder.h" #include "digester.h" @@ -76,7 +77,7 @@ DCPDecoder::DCPDecoder (shared_ptr film, shared_ptrvideo) { video = make_shared(this, content); } - if (content->audio) { + if (content->has_mapped_audio()) { audio = make_shared(this, content->audio, fast); } for (auto i: content->text) { @@ -104,7 +105,6 @@ DCPDecoder::DCPDecoder (shared_ptr film, shared_ptrlazy_digest() == _lazy_digest) { _reels = old->_reels; } else { - auto cpl_list = dcp::find_and_resolve_cpls(content->directories(), tolerant); if (cpl_list.empty()) { @@ -136,6 +136,9 @@ DCPDecoder::DCPDecoder (shared_ptr film, shared_ptrid(), is_copy.font().get())); + } else { + is_copy.set_font(_font_id_allocator.default_font_id()); + } strings.push_back(is_copy); } @@ -368,8 +375,7 @@ DCPDecoder::get_readers () return; } - DCPOMATIC_ASSERT(video); - if (!video->ignore() && (*_reel)->main_picture()) { + if (video && !video->ignore() && (*_reel)->main_picture()) { auto asset = (*_reel)->main_picture()->asset (); auto mono = dynamic_pointer_cast (asset); auto stereo = dynamic_pointer_cast (asset); @@ -388,8 +394,7 @@ DCPDecoder::get_readers () _stereo_reader.reset (); } - DCPOMATIC_ASSERT(audio); - if (!audio->ignore() && (*_reel)->main_sound()) { + if (audio && !audio->ignore() && (*_reel)->main_sound()) { _sound_reader = (*_reel)->main_sound()->asset()->start_read (); _sound_reader->set_check_hmac (false); } else { @@ -445,10 +450,12 @@ DCPDecoder::seek (ContentTime t, bool accurate) /* Pass texts in the pre-roll */ - auto const vfr = _dcp_content->active_video_frame_rate (film()); - for (int i = 0; i < pre_roll_seconds * vfr; ++i) { - pass_texts (pre, (*_reel)->main_picture()->asset()->size()); - pre += ContentTime::from_frames (1, vfr); + if (_reel != _reels.end()) { + auto const vfr = _dcp_content->active_video_frame_rate (film()); + for (int i = 0; i < pre_roll_seconds * vfr; ++i) { + pass_texts (pre, (*_reel)->main_picture()->asset()->size()); + pre += ContentTime::from_frames (1, vfr); + } } /* Seek to correct position */