From: Carl Hetherington Date: Fri, 19 Apr 2019 23:29:55 +0000 (+0100) Subject: Don't set up decoder parts for DCPs unless they can be played X-Git-Tag: v2.13.149 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=refs%2Ftags%2Fv2.13.149;p=dcpomatic.git Don't set up decoder parts for DCPs unless they can be played (i.e. are not encrypted and not missing assets). Fixes full audio buffers on locates with large encrypted DCPs and no KDMs; in these cases silent audio is created by the fill_audio() at the bottom of Player::pass() but no video is created by anybody. --- diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index 85dd28006..8179ef009 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -60,15 +60,17 @@ DCPDecoder::DCPDecoder (shared_ptr film, shared_ptrvideo) { - video.reset (new VideoDecoder (this, c)); - } - if (c->audio) { - audio.reset (new AudioDecoder (this, c->audio, fast)); - } - BOOST_FOREACH (shared_ptr i, c->text) { - /* XXX: this time here should be the time of the first subtitle, not 0 */ - text.push_back (shared_ptr (new TextDecoder (this, i, ContentTime()))); + if (c->can_be_played()) { + if (c->video) { + video.reset (new VideoDecoder (this, c)); + } + if (c->audio) { + audio.reset (new AudioDecoder (this, c->audio, fast)); + } + BOOST_FOREACH (shared_ptr i, c->text) { + /* XXX: this time here should be the time of the first subtitle, not 0 */ + text.push_back (shared_ptr (new TextDecoder (this, i, ContentTime()))); + } } list > cpl_list = cpls ();