Don't set up decoder parts for DCPs unless they can be played v2.13.149
authorCarl Hetherington <cth@carlh.net>
Fri, 19 Apr 2019 23:29:55 +0000 (00:29 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 19 Apr 2019 23:29:55 +0000 (00:29 +0100)
(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

index 85dd280064ac02d8743420edee9cdf31e7a02552..8179ef0096b7c1e4bd8a7852af36119c3cacb28d 100644 (file)
@@ -60,15 +60,17 @@ DCPDecoder::DCPDecoder (shared_ptr<const Film> film, shared_ptr<const DCPContent
        , Decoder (film)
        , _decode_referenced (false)
 {
-       if (c->video) {
-               video.reset (new VideoDecoder (this, c));
-       }
-       if (c->audio) {
-               audio.reset (new AudioDecoder (this, c->audio, fast));
-       }
-       BOOST_FOREACH (shared_ptr<TextContent> i, c->text) {
-               /* XXX: this time here should be the time of the first subtitle, not 0 */
-               text.push_back (shared_ptr<TextDecoder> (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<TextContent> i, c->text) {
+                       /* XXX: this time here should be the time of the first subtitle, not 0 */
+                       text.push_back (shared_ptr<TextDecoder> (new TextDecoder (this, i, ContentTime())));
+               }
        }
 
        list<shared_ptr<dcp::CPL> > cpl_list = cpls ();