From 5fd2395577ff5eedca060e8b333129ad6de9aa27 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 20 Apr 2019 00:29:55 +0100 Subject: [PATCH] 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. --- src/lib/dcp_decoder.cc | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) 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 (); -- 2.30.2