diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-09-03 01:52:14 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-09-03 14:46:38 +0200 |
| commit | 1d13ce8be4df51e85b7222a7c9d357366c841a89 (patch) | |
| tree | 1be0a392051a1f520eef79778379497db800c22e /src/cpl.cc | |
| parent | 6740903432bca2ab447a47ac773a735d4f1f2e50 (diff) | |
Properly support ContentKind scope attribute.v1.8.26
Diffstat (limited to 'src/cpl.cc')
| -rw-r--r-- | src/cpl.cc | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -122,7 +122,8 @@ CPL::CPL (boost::filesystem::path file) _creator = f.optional_string_child("Creator").get_value_or(""); _issue_date = f.string_child ("IssueDate"); _content_title_text = f.string_child ("ContentTitleText"); - _content_kind = ContentKind::from_name(f.string_child("ContentKind")); + auto content_kind = f.node_child("ContentKind"); + _content_kind = ContentKind(content_kind->content(), content_kind->optional_string_attribute("scope")); shared_ptr<cxml::Node> content_version = f.optional_node_child ("ContentVersion"); if (content_version) { /* XXX: SMPTE should insist that Id is present */ @@ -198,7 +199,11 @@ CPL::write_xml (boost::filesystem::path file, shared_ptr<const CertificateChain> root->add_child("Issuer")->add_child_text (_issuer); root->add_child("Creator")->add_child_text (_creator); root->add_child("ContentTitleText")->add_child_text (_content_title_text); - root->add_child("ContentKind")->add_child_text(_content_kind.name()); + auto content_kind = root->add_child("ContentKind"); + content_kind->add_child_text(_content_kind.name()); + if (_content_kind.scope()) { + content_kind->set_attribute("scope", *_content_kind.scope()); + } if (_content_versions.empty()) { ContentVersion cv; cv.as_xml (root); |
