From: Carl Hetherington Date: Fri, 15 Mar 2019 00:49:41 +0000 (+0000) Subject: Move asset refs and hash from ReelAsset to ReelMXF. X-Git-Tag: v1.8.0~474 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=2d60083498861ac30c751dbf0ca387573df6dc68;p=libdcp.git Move asset refs and hash from ReelAsset to ReelMXF. --- diff --git a/src/cpl.cc b/src/cpl.cc index 3eeb102c..0bf15824 100644 --- a/src/cpl.cc +++ b/src/cpl.cc @@ -175,10 +175,10 @@ CPL::write_xml (boost::filesystem::path file, Standard standard, shared_ptr > -CPL::reel_assets () +list > +CPL::reel_mxfs () { - list > c; + list > c; BOOST_FOREACH (shared_ptr i, _reels) { if (i->main_picture ()) { @@ -201,10 +201,10 @@ CPL::reel_assets () return c; } -list > -CPL::reel_assets () const +list > +CPL::reel_mxfs () const { - list > c; + list > c; BOOST_FOREACH (shared_ptr i, _reels) { if (i->main_picture ()) { diff --git a/src/cpl.h b/src/cpl.h index 259281dc..553f5492 100644 --- a/src/cpl.h +++ b/src/cpl.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Carl Hetherington + Copyright (C) 2014-2019 Carl Hetherington This file is part of libdcp. @@ -51,7 +51,7 @@ namespace dcp { -class ReelAsset; +class ReelMXF; class Reel; class XMLMetadata; class MXFMetadata; @@ -116,10 +116,10 @@ public: return _reels; } - /** @return the ReelAssets in this CPL in all reels. + /** @return the ReelMXFs in this CPL in all reels. */ - std::list > reel_assets () const; - std::list > reel_assets (); + std::list > reel_mxfs () const; + std::list > reel_mxfs (); bool encrypted () const; diff --git a/src/dcp.cc b/src/dcp.cc index 5d908530..52598610 100644 --- a/src/dcp.cc +++ b/src/dcp.cc @@ -476,7 +476,7 @@ DCP::assets (bool ignore_unresolved) const list > assets; BOOST_FOREACH (shared_ptr i, cpls ()) { assets.push_back (i); - BOOST_FOREACH (shared_ptr j, i->reel_assets ()) { + BOOST_FOREACH (shared_ptr j, i->reel_mxfs()) { if (ignore_unresolved && !j->asset_ref().resolved()) { continue; } diff --git a/src/decrypted_kdm.cc b/src/decrypted_kdm.cc index 756028d1..4bd9a9d5 100644 --- a/src/decrypted_kdm.cc +++ b/src/decrypted_kdm.cc @@ -271,10 +271,9 @@ DecryptedKDM::DecryptedKDM ( { /* Create DecryptedKDMKey objects for each encryptable asset */ bool did_one = false; - BOOST_FOREACH(shared_ptr i, cpl->reel_assets ()) { - shared_ptr mxf = boost::dynamic_pointer_cast (i); - if (mxf && mxf->key_id ()) { - add_key (mxf->key_type(), mxf->key_id().get(), key, cpl->id(), SMPTE); + BOOST_FOREACH(shared_ptr i, cpl->reel_mxfs()) { + if (i->key_id()) { + add_key (i->key_type(), i->key_id().get(), key, cpl->id(), SMPTE); did_one = true; } } diff --git a/src/reel_asset.cc b/src/reel_asset.cc index 797d1c40..22583223 100644 --- a/src/reel_asset.cc +++ b/src/reel_asset.cc @@ -46,6 +46,7 @@ using std::pair; using std::string; using std::make_pair; using boost::shared_ptr; +using boost::optional; using namespace dcp; /** Construct a ReelAsset. @@ -56,12 +57,10 @@ using namespace dcp; */ ReelAsset::ReelAsset (shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point) : Object (asset->id ()) - , _asset_ref (asset) , _edit_rate (edit_rate) , _intrinsic_duration (intrinsic_duration) , _entry_point (entry_point) , _duration (intrinsic_duration - entry_point) - , _hash (asset->hash ()) { /* default _annotation_text to the leaf name of our file */ if (asset->file ()) { @@ -71,19 +70,17 @@ ReelAsset::ReelAsset (shared_ptr asset, Fraction edit_rate, int64_t intri ReelAsset::ReelAsset (shared_ptr node) : Object (remove_urn_uuid (node->string_child ("Id"))) - , _asset_ref (_id) , _annotation_text (node->optional_string_child ("AnnotationText").get_value_or ("")) , _edit_rate (Fraction (node->string_child ("EditRate"))) , _intrinsic_duration (node->number_child ("IntrinsicDuration")) , _entry_point (node->number_child ("EntryPoint")) , _duration (node->number_child ("Duration")) - , _hash (node->optional_string_child ("Hash")) { } xmlpp::Node* -ReelAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const +ReelAsset::write_to_cpl_base (xmlpp::Node* node, Standard standard, optional hash) const { xmlpp::Element* a = node->add_child (cpl_node_name (standard)); pair const attr = cpl_node_attribute (standard); @@ -100,8 +97,8 @@ ReelAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const a->add_child("IntrinsicDuration")->add_child_text (raw_convert (_intrinsic_duration)); a->add_child("EntryPoint")->add_child_text (raw_convert (_entry_point)); a->add_child("Duration")->add_child_text (raw_convert (_duration)); - if (_hash) { - a->add_child("Hash")->add_child_text (_hash.get()); + if (hash) { + a->add_child("Hash")->add_child_text (hash.get()); } return a; } @@ -119,7 +116,7 @@ ReelAsset::cpl_node_namespace (Standard) const } bool -ReelAsset::equals (shared_ptr other, EqualityOptions opt, NoteHandler note) const +ReelAsset::asset_equals (shared_ptr other, EqualityOptions opt, NoteHandler note) const { if (_annotation_text != other->_annotation_text) { string const s = "Reel: annotation texts differ (" + _annotation_text + " vs " + other->_annotation_text + ")\n"; @@ -151,18 +148,5 @@ ReelAsset::equals (shared_ptr other, EqualityOptions opt, NoteH return false; } - if (_hash != other->_hash) { - if (!opt.reel_hashes_can_differ) { - note (DCP_ERROR, "Reel: hashes differ"); - return false; - } else { - note (DCP_NOTE, "Reel: hashes differ"); - } - } - - if (_asset_ref.resolved () && other->_asset_ref.resolved ()) { - return _asset_ref->equals (other->_asset_ref.asset(), opt, note); - } - return true; } diff --git a/src/reel_asset.h b/src/reel_asset.h index 974d9af0..9f024239 100644 --- a/src/reel_asset.h +++ b/src/reel_asset.h @@ -68,18 +68,7 @@ public: ReelAsset (boost::shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point); explicit ReelAsset (boost::shared_ptr); - virtual xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const; - virtual bool equals (boost::shared_ptr, EqualityOptions, NoteHandler) const; - - /** @return a Ref to our actual asset */ - Ref const & asset_ref () const { - return _asset_ref; - } - - /** @return a Ref to our actual asset */ - Ref & asset_ref () { - return _asset_ref; - } + virtual xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const = 0; Fraction edit_rate () const { return _edit_rate; @@ -105,13 +94,6 @@ public: return _duration; } - /** @return the asset's hash, if this ReelAsset has been created from one, - * otherwise the hash written to the CPL for this asset (if present). - */ - boost::optional hash () const { - return _hash; - } - std::string annotation_text () const { return _annotation_text; } @@ -120,17 +102,9 @@ public: _annotation_text = at; } -protected: - - template - boost::shared_ptr asset_of_type () const { - return boost::dynamic_pointer_cast (_asset_ref.asset ()); - } + bool asset_equals (boost::shared_ptr, EqualityOptions, NoteHandler) const; - template - boost::shared_ptr asset_of_type () { - return boost::dynamic_pointer_cast (_asset_ref.asset ()); - } +protected: /** @return the node name that this asset uses in the CPL's <Reel> node * e.g. MainPicture, MainSound etc. @@ -143,10 +117,7 @@ protected: /** @return Any namespace that should be used on the asset's node in the CPL */ virtual std::pair cpl_node_namespace (Standard) const; - /** Reference to the asset (MXF or XML file) that this reel entry - * applies to. - */ - Ref _asset_ref; + xmlpp::Node* write_to_cpl_base (xmlpp::Node* node, Standard standard, boost::optional hash) const; private: std::string _annotation_text; ///< The <AnnotationText> from the reel's entry for this asset @@ -154,8 +125,6 @@ private: int64_t _intrinsic_duration; ///< The <IntrinsicDuration> from the reel's entry for this asset int64_t _entry_point; ///< The <EntryPoint> from the reel's entry for this asset int64_t _duration; ///< The <Duration> from the reel's entry for this asset - /** Either our asset's computed hash or the hash read in from the CPL, if it's present */ - boost::optional _hash; }; } diff --git a/src/reel_atmos_asset.cc b/src/reel_atmos_asset.cc index 636a7a79..f5dbc9fa 100644 --- a/src/reel_atmos_asset.cc +++ b/src/reel_atmos_asset.cc @@ -48,6 +48,7 @@ using namespace dcp; ReelAtmosAsset::ReelAtmosAsset (boost::shared_ptr asset, int64_t entry_point) : ReelAsset (asset, asset->edit_rate(), asset->intrinsic_duration(), entry_point) + , ReelMXF (asset, asset->key_id()) { } @@ -81,7 +82,20 @@ ReelAtmosAsset::key_type () const xmlpp::Node * ReelAtmosAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const { - xmlpp::Node* asset = ReelAsset::write_to_cpl (node, standard); + xmlpp::Node* asset = write_to_cpl_base (node, standard, hash()); asset->add_child("axd:DataType")->add_child_text("urn:smpte:ul:060e2b34.04010105.0e090604.00000000"); return asset; } + +bool +ReelAtmosAsset::equals (shared_ptr other, EqualityOptions opt, NoteHandler note) const +{ + if (!asset_equals (other, opt, note)) { + return false; + } + if (!mxf_equals (other, opt, note)) { + return false; + } + + return true; +} diff --git a/src/reel_atmos_asset.h b/src/reel_atmos_asset.h index e93a5414..6fb4bf51 100644 --- a/src/reel_atmos_asset.h +++ b/src/reel_atmos_asset.h @@ -60,6 +60,7 @@ public: } xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const; + bool equals (boost::shared_ptr, EqualityOptions, NoteHandler) const; private: std::string key_type () const; diff --git a/src/reel_closed_caption_asset.cc b/src/reel_closed_caption_asset.cc index b7629011..f71c39f6 100644 --- a/src/reel_closed_caption_asset.cc +++ b/src/reel_closed_caption_asset.cc @@ -51,7 +51,7 @@ using namespace dcp; ReelClosedCaptionAsset::ReelClosedCaptionAsset (boost::shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point) : ReelAsset (asset, edit_rate, intrinsic_duration, entry_point) - , ReelMXF (dynamic_pointer_cast(asset) ? dynamic_pointer_cast(asset)->key_id() : optional()) + , ReelMXF (asset, dynamic_pointer_cast(asset) ? dynamic_pointer_cast(asset)->key_id() : optional()) { } @@ -99,7 +99,7 @@ ReelClosedCaptionAsset::key_type () const xmlpp::Node * ReelClosedCaptionAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const { - xmlpp::Node* asset = ReelAsset::write_to_cpl (node, standard); + xmlpp::Node* asset = write_to_cpl_base (node, standard, hash()); if (key_id()) { /* Find */ @@ -113,3 +113,16 @@ ReelClosedCaptionAsset::write_to_cpl (xmlpp::Node* node, Standard standard) cons return asset; } + +bool +ReelClosedCaptionAsset::equals (shared_ptr other, EqualityOptions opt, NoteHandler note) const +{ + if (!asset_equals (other, opt, note)) { + return false; + } + if (!mxf_equals (other, opt, note)) { + return false; + } + + return true; +} diff --git a/src/reel_closed_caption_asset.h b/src/reel_closed_caption_asset.h index 80e444d9..6ed50ae0 100644 --- a/src/reel_closed_caption_asset.h +++ b/src/reel_closed_caption_asset.h @@ -56,6 +56,7 @@ public: explicit ReelClosedCaptionAsset (boost::shared_ptr); xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const; + bool equals (boost::shared_ptr, EqualityOptions, NoteHandler) const; boost::shared_ptr asset () const { return asset_of_type (); diff --git a/src/reel_mxf.cc b/src/reel_mxf.cc index 9c2d3b60..f170157e 100644 --- a/src/reel_mxf.cc +++ b/src/reel_mxf.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2015 Carl Hetherington + Copyright (C) 2012-2019 Carl Hetherington This file is part of libdcp. @@ -43,16 +43,39 @@ using boost::shared_ptr; using boost::optional; using namespace dcp; -ReelMXF::ReelMXF (optional key_id) - : _key_id (key_id) +ReelMXF::ReelMXF (shared_ptr asset, optional key_id) + : _asset_ref (asset) + , _key_id (key_id) + , _hash (asset->hash()) { } ReelMXF::ReelMXF (shared_ptr node) - : _key_id (node->optional_string_child ("KeyId")) + : _asset_ref (remove_urn_uuid(node->string_child("Id"))) + , _key_id (node->optional_string_child ("KeyId")) + , _hash (node->optional_string_child ("Hash")) { if (_key_id) { _key_id = remove_urn_uuid (*_key_id); } } + +bool +ReelMXF::mxf_equals (shared_ptr other, EqualityOptions opt, NoteHandler note) const +{ + if (_hash != other->_hash) { + if (!opt.reel_hashes_can_differ) { + note (DCP_ERROR, "Reel: hashes differ"); + return false; + } else { + note (DCP_NOTE, "Reel: hashes differ"); + } + } + + if (_asset_ref.resolved() && other->_asset_ref.resolved()) { + return _asset_ref->equals (other->_asset_ref.asset(), opt, note); + } + + return true; +} diff --git a/src/reel_mxf.h b/src/reel_mxf.h index 91625579..7bc8f75b 100644 --- a/src/reel_mxf.h +++ b/src/reel_mxf.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2015 Carl Hetherington + Copyright (C) 2012-2019 Carl Hetherington This file is part of libdcp. @@ -35,9 +35,10 @@ * @brief ReelMXF */ -#ifndef LIBDCP_REEL_ENCRYPTABLE_ASSET_H -#define LIBDCP_REEL_ENCRYPTABLE_ASSET_H +#ifndef LIBDCP_REEL_MXF_H +#define LIBDCP_REEL_MXF_H +#include "ref.h" #include #include #include @@ -54,14 +55,30 @@ namespace dcp { class ReelMXF { public: - ReelMXF () {} - explicit ReelMXF (boost::optional key_id); + explicit ReelMXF (boost::shared_ptr asset, boost::optional key_id); explicit ReelMXF (boost::shared_ptr); virtual ~ReelMXF () {} /** @return the 4-character key type for this MXF (MDIK, MDAK, etc.) */ virtual std::string key_type () const = 0; + /** @return a Ref to our actual asset */ + Ref const & asset_ref () const { + return _asset_ref; + } + + /** @return a Ref to our actual asset */ + Ref & asset_ref () { + return _asset_ref; + } + + /** @return the asset's hash, if this ReelMXF has been created from one, + * otherwise the hash written to the CPL for this asset (if present). + */ + boost::optional hash () const { + return _hash; + } + /** @return true if a KeyId is specified for this asset, implying * that its content is encrypted. */ @@ -76,8 +93,29 @@ public: return _key_id; } + bool mxf_equals (boost::shared_ptr other, EqualityOptions opt, NoteHandler note) const; + +protected: + + template + boost::shared_ptr asset_of_type () const { + return boost::dynamic_pointer_cast (_asset_ref.asset ()); + } + + template + boost::shared_ptr asset_of_type () { + return boost::dynamic_pointer_cast (_asset_ref.asset ()); + } + + /** Reference to the asset (MXF or XML file) that this reel entry + * applies to. + */ + Ref _asset_ref; + private: boost::optional _key_id; ///< The <KeyId> from the reel's entry for this asset, if there is one + /** Either our asset's computed hash or the hash read in from the CPL, if it's present */ + boost::optional _hash; }; } diff --git a/src/reel_picture_asset.cc b/src/reel_picture_asset.cc index 5eaf9157..d2ba358f 100644 --- a/src/reel_picture_asset.cc +++ b/src/reel_picture_asset.cc @@ -54,7 +54,7 @@ using namespace dcp; ReelPictureAsset::ReelPictureAsset (shared_ptr asset, int64_t entry_point) : ReelAsset (asset, asset->edit_rate(), asset->intrinsic_duration(), entry_point) - , ReelMXF (asset->key_id()) + , ReelMXF (asset, asset->key_id()) , _frame_rate (asset->frame_rate ()) , _screen_aspect_ratio (asset->screen_aspect_ratio ()) { @@ -82,7 +82,7 @@ ReelPictureAsset::ReelPictureAsset (shared_ptr node) xmlpp::Node* ReelPictureAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const { - xmlpp::Node* asset = ReelAsset::write_to_cpl (node, standard); + xmlpp::Node* asset = write_to_cpl_base (node, standard, hash()); asset->add_child("FrameRate")->add_child_text(String::compose("%1 %2", _frame_rate.numerator, _frame_rate.denominator)); if (standard == INTEROP) { @@ -128,9 +128,12 @@ ReelPictureAsset::key_type () const } bool -ReelPictureAsset::equals (shared_ptr other, EqualityOptions opt, NoteHandler note) const +ReelPictureAsset::equals (shared_ptr other, EqualityOptions opt, NoteHandler note) const { - if (!ReelAsset::equals (other, opt, note)) { + if (!asset_equals (other, opt, note)) { + return false; + } + if (!mxf_equals (other, opt, note)) { return false; } diff --git a/src/reel_picture_asset.h b/src/reel_picture_asset.h index 20cf0255..88729148 100644 --- a/src/reel_picture_asset.h +++ b/src/reel_picture_asset.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2014-2015 Carl Hetherington + Copyright (C) 2014-2019 Carl Hetherington This file is part of libdcp. @@ -54,7 +54,7 @@ public: explicit ReelPictureAsset (boost::shared_ptr); virtual xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const; - virtual bool equals (boost::shared_ptr, EqualityOptions, NoteHandler) const; + bool equals (boost::shared_ptr, EqualityOptions, NoteHandler) const; /** @return the PictureAsset that this object refers to */ boost::shared_ptr asset () const { diff --git a/src/reel_sound_asset.cc b/src/reel_sound_asset.cc index baacfe72..ab763cb3 100644 --- a/src/reel_sound_asset.cc +++ b/src/reel_sound_asset.cc @@ -46,7 +46,7 @@ using namespace dcp; ReelSoundAsset::ReelSoundAsset (shared_ptr asset, int64_t entry_point) : ReelAsset (asset, asset->edit_rate(), asset->intrinsic_duration(), entry_point) - , ReelMXF (asset->key_id()) + , ReelMXF (asset, asset->key_id()) { } @@ -74,7 +74,7 @@ ReelSoundAsset::key_type () const xmlpp::Node * ReelSoundAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const { - xmlpp::Node* asset = ReelAsset::write_to_cpl (node, standard); + xmlpp::Node* asset = write_to_cpl_base (node, standard, hash()); if (key_id ()) { /* Find */ @@ -84,3 +84,16 @@ ReelSoundAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const return asset; } + +bool +ReelSoundAsset::equals (shared_ptr other, EqualityOptions opt, NoteHandler note) const +{ + if (!asset_equals (other, opt, note)) { + return false; + } + if (!mxf_equals (other, opt, note)) { + return false; + } + + return true; +} diff --git a/src/reel_sound_asset.h b/src/reel_sound_asset.h index 2fb01c8d..57d14bc6 100644 --- a/src/reel_sound_asset.h +++ b/src/reel_sound_asset.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2014-2015 Carl Hetherington + Copyright (C) 2014-2019 Carl Hetherington This file is part of libdcp. @@ -53,6 +53,7 @@ public: explicit ReelSoundAsset (boost::shared_ptr); xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const; + bool equals (boost::shared_ptr, EqualityOptions, NoteHandler) const; /** @return the SoundAsset that this object refers to */ boost::shared_ptr asset () { diff --git a/src/reel_subtitle_asset.cc b/src/reel_subtitle_asset.cc index 75116b2b..1bb8ccca 100644 --- a/src/reel_subtitle_asset.cc +++ b/src/reel_subtitle_asset.cc @@ -48,7 +48,7 @@ using namespace dcp; ReelSubtitleAsset::ReelSubtitleAsset (boost::shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point) : ReelAsset (asset, edit_rate, intrinsic_duration, entry_point) - , ReelMXF (dynamic_pointer_cast(asset) ? dynamic_pointer_cast(asset)->key_id() : optional()) + , ReelMXF (asset, dynamic_pointer_cast(asset) ? dynamic_pointer_cast(asset)->key_id() : optional()) { } @@ -76,7 +76,7 @@ ReelSubtitleAsset::key_type () const xmlpp::Node * ReelSubtitleAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const { - xmlpp::Node* asset = ReelAsset::write_to_cpl (node, standard); + xmlpp::Node* asset = write_to_cpl_base (node, standard, hash()); if (key_id ()) { /* Find */ @@ -86,3 +86,16 @@ ReelSubtitleAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const return asset; } + +bool +ReelSubtitleAsset::equals (shared_ptr other, EqualityOptions opt, NoteHandler note) const +{ + if (!asset_equals (other, opt, note)) { + return false; + } + if (!mxf_equals (other, opt, note)) { + return false; + } + + return true; +} diff --git a/src/reel_subtitle_asset.h b/src/reel_subtitle_asset.h index 8e0edc49..4cc03cf1 100644 --- a/src/reel_subtitle_asset.h +++ b/src/reel_subtitle_asset.h @@ -56,6 +56,7 @@ public: explicit ReelSubtitleAsset (boost::shared_ptr); xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const; + bool equals (boost::shared_ptr, EqualityOptions, NoteHandler) const; boost::shared_ptr asset () const { return asset_of_type (); diff --git a/src/verify.cc b/src/verify.cc index 4a656874..9ab9b150 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -61,19 +61,19 @@ enum Result { }; static Result -verify_asset (shared_ptr dcp, shared_ptr reel_asset, function progress) +verify_asset (shared_ptr dcp, shared_ptr reel_mxf, function progress) { - string const actual_hash = reel_asset->asset_ref()->hash(progress); + string const actual_hash = reel_mxf->asset_ref()->hash(progress); list > pkls = dcp->pkls(); /* We've read this DCP in so it must have at least one PKL */ DCP_ASSERT (!pkls.empty()); - shared_ptr asset = reel_asset->asset_ref().asset(); + shared_ptr asset = reel_mxf->asset_ref().asset(); optional pkl_hash; BOOST_FOREACH (shared_ptr i, pkls) { - pkl_hash = i->hash (reel_asset->asset_ref()->id()); + pkl_hash = i->hash (reel_mxf->asset_ref()->id()); if (pkl_hash) { break; } @@ -81,7 +81,7 @@ verify_asset (shared_ptr dcp, shared_ptr reel_asset, function cpl_hash = reel_asset->hash(); + optional cpl_hash = reel_mxf->hash(); if (cpl_hash && *cpl_hash != *pkl_hash) { return RESULT_CPL_PKL_DIFFER; }