X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Freel_subtitle_asset.cc;h=a90513d5c1fed7aede33b306526a85bb181aa735;hb=b578af0819126de2758687f9eae71dbcf5ed0325;hp=ddb1b9726fa5856e6e8452b3205e9f9a3e8166a6;hpb=926aff7db1e5ad6c02743608e3792fdca39eea4a;p=libdcp.git diff --git a/src/reel_subtitle_asset.cc b/src/reel_subtitle_asset.cc index ddb1b972..a90513d5 100644 --- a/src/reel_subtitle_asset.cc +++ b/src/reel_subtitle_asset.cc @@ -47,8 +47,8 @@ using boost::optional; 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()) + : ReelAsset (asset->id(), edit_rate, intrinsic_duration, entry_point) + , ReelMXF (asset, dynamic_pointer_cast(asset) ? dynamic_pointer_cast(asset)->key_id() : optional()) { } @@ -73,16 +73,29 @@ ReelSubtitleAsset::key_type () const return "MDSK"; } -void +xmlpp::Node * ReelSubtitleAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const { - ReelAsset::write_to_cpl (node, standard); + xmlpp::Node* asset = write_to_cpl_base (node, standard, hash()); - if (key_id ()) { - /* Find */ - xmlpp::Node* ms = find_child (node, cpl_node_name (standard)); + if (key_id ()) { /* Find */ - xmlpp::Node* hash = find_child (ms, "Hash"); - ms->add_child_before (hash, "KeyId")->add_child_text ("urn:uuid:" + key_id().get ()); + xmlpp::Node* hash = find_child (asset, "Hash"); + asset->add_child_before(hash, "KeyId")->add_child_text("urn:uuid:" + key_id().get()); } + + 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; }