diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-11-29 01:09:16 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-12-08 21:29:37 +0100 |
| commit | f97db44f499d5f1b1749a6f188ebba9b5c101f1f (patch) | |
| tree | 48a7d6b1d2e81858046e28b2b14bbf1f685ad9ac /src | |
| parent | d0255af1234de0f90017930b2ceb7e75ec14ca95 (diff) | |
Fix DCP Constraints Profile verification in the presence of other CPL metadata Properties.
Diffstat (limited to 'src')
| -rw-r--r-- | src/verify.cc | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/verify.cc b/src/verify.cc index 8ad5f8a2..8bf65fc3 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -1300,17 +1300,14 @@ dcp::verify_extension_metadata(Context& context) } } if (auto property_list = extension->optional_node_child("PropertyList")) { - if (auto property = property_list->optional_node_child("Property")) { - if (auto name = property->optional_node_child("Name")) { - if (name->content() != "DCP Constraints Profile") { - malformed = "<Name> property should be 'DCP Constraints Profile'"; - } - } - if (auto value = property->optional_node_child("Value")) { - if (value->content() != "SMPTE-RDD-52:2020-Bv2.1") { - malformed = "<Value> property should be 'SMPTE-RDD-52:2020-Bv2.1'"; - } - } + auto properties = property_list->node_children("Property"); + auto is_bv21 = [](shared_ptr<const cxml::Node> property) { + auto name = property->optional_node_child("Name"); + auto value = property->optional_node_child("Value"); + return name && value && name->content() == "DCP Constraints Profile" && value->content() == "SMPTE-RDD-52:2020-Bv2.1"; + }; + if (!std::any_of(properties.begin(), properties.end(), is_bv21)) { + malformed = "No correctly-formed DCP Constraints Profile found"; } } } |
