From 488e3d1bd5e6b17d49f6db4df14c64f4b64db89b Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 13 Apr 2021 23:36:22 +0200 Subject: Remove ReelEncryptableAsset and tidy up a bit. --- src/verify.cc | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/verify.cc') diff --git a/src/verify.cc b/src/verify.cc index e176362a..a2298f38 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -1088,14 +1088,9 @@ pkl_has_encrypted_assets (shared_ptr dcp, shared_ptr pkl) for (auto i: dcp->cpls()) { for (auto j: i->reel_file_assets()) { if (j->asset_ref().resolved()) { - /* It's a bit surprising / broken but Interop subtitle assets are represented - * in reels by ReelSubtitleAsset which inherits ReelEncryptableAsset, so it's possible for - * ReelEncryptableAssets to have assets which are not MXFs. - */ - if (auto asset = dynamic_pointer_cast(j->asset_ref().asset())) { - if (asset->encrypted()) { - encrypted.push_back(j->asset_ref().id()); - } + auto mxf = dynamic_pointer_cast(j->asset_ref().asset()); + if (mxf && mxf->encrypted()) { + encrypted.push_back(j->asset_ref().id()); } } } @@ -1242,7 +1237,7 @@ dcp::verify ( notes.push_back ({VerificationNote::Type::ERROR, VerificationNote::Code::INVALID_INTRINSIC_DURATION, i->id()}); } auto file_asset = dynamic_pointer_cast(i); - if (dynamic_pointer_cast(i) && !file_asset->hash()) { + if (i->encryptable() && !file_asset->hash()) { notes.push_back ({VerificationNote::Type::BV21_ERROR, VerificationNote::Code::MISSING_HASH, i->id()}); } } -- cgit v1.2.3