diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-03-06 01:17:27 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-03-11 09:25:26 +0100 |
| commit | 8c06e7d56542d16ea6e596056801270bae6d09e6 (patch) | |
| tree | 2dd1ae33c698b70c5b2cb114cbaad8254cbf95a0 /src/lib/dcp_content.cc | |
| parent | 4d2418d26ea16946931dc2024cc7afd4519fc9b9 (diff) | |
Take has_non_zero_entry_point() from examiner and store it.
Diffstat (limited to 'src/lib/dcp_content.cc')
| -rw-r--r-- | src/lib/dcp_content.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc index b1febc5d1..35ef15442 100644 --- a/src/lib/dcp_content.cc +++ b/src/lib/dcp_content.cc @@ -163,6 +163,13 @@ DCPContent::DCPContent (cxml::ConstNodePtr node, int version) } _active_audio_channels = node->optional_number_child<int>("ActiveAudioChannels"); + + for (auto non_zero: node->node_children("HasNonZeroEntryPoint")) { + try { + auto type = string_to_text_type(non_zero->string_attribute("type")); + _has_non_zero_entry_point[type] = non_zero->content() == "1"; + } catch (MetadataError&) {} + } } void @@ -308,6 +315,7 @@ DCPContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job) } _ratings = examiner->ratings (); _content_versions = examiner->content_versions (); + _has_non_zero_entry_point = examiner->has_non_zero_entry_point(); } if (needed_assets == needs_assets()) { @@ -427,6 +435,14 @@ DCPContent::as_xml (xmlpp::Node* node, bool with_paths) const if (_active_audio_channels) { node->add_child("ActiveAudioChannels")->add_child_text(raw_convert<string>(*_active_audio_channels)); } + + for (auto i = 0; i < static_cast<int>(TextType::COUNT); ++i) { + if (_has_non_zero_entry_point[i]) { + auto has = node->add_child("HasNonZeroEntryPoint"); + has->add_child_text("1"); + has->set_attribute("type", text_type_to_string(static_cast<TextType>(i))); + } + } } DCPTime |
