summaryrefslogtreecommitdiff
path: root/src/cpl.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-04-17 22:19:02 +0200
committerCarl Hetherington <cth@carlh.net>2024-04-17 22:19:02 +0200
commit869462070671b273ac528e075ac1c00a417cc8a0 (patch)
treec6a98899ff9a7f86ab061730a5fdc9b52d787a2c /src/cpl.cc
parent0a8f2a1a2058f0461a7f978295e31af34a03bb40 (diff)
Make some not-so-important CPL read errors non-fatal (DoM #2797).v1.8.99
Diffstat (limited to 'src/cpl.cc')
-rw-r--r--src/cpl.cc25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/cpl.cc b/src/cpl.cc
index 5ff86fda..6a25863a 100644
--- a/src/cpl.cc
+++ b/src/cpl.cc
@@ -104,7 +104,7 @@ CPL::CPL (string annotation_text, ContentKind content_kind, Standard standard)
}
-CPL::CPL (boost::filesystem::path file)
+CPL::CPL (boost::filesystem::path file, vector<dcp::VerificationNote>* notes)
: Asset (file)
, _content_kind (ContentKind::FEATURE)
{
@@ -116,7 +116,17 @@ CPL::CPL (boost::filesystem::path file)
} else if (f.namespace_uri() == cpl_smpte_ns) {
_standard = Standard::SMPTE;
} else {
- boost::throw_exception (XMLError ("Unrecognised CPL namespace " + f.namespace_uri()));
+ if (notes) {
+ notes->push_back(
+ dcp::VerificationNote(
+ dcp::VerificationNote::Type::ERROR,
+ dcp::VerificationNote::Code::INVALID_CPL_NAMESPACE,
+ f.namespace_uri(),
+ file
+ )
+ );
+ }
+ _standard = Standard::INTEROP;
}
_id = remove_urn_uuid (f.string_child ("Id"));
@@ -139,7 +149,16 @@ CPL::CPL (boost::filesystem::path file)
content_version->done ();
} else if (_standard == Standard::SMPTE) {
/* ContentVersion is required in SMPTE */
- throw XMLError ("Missing ContentVersion tag in CPL");
+ if (notes) {
+ notes->push_back(
+ dcp::VerificationNote(
+ dcp::VerificationNote::Type::ERROR,
+ dcp::VerificationNote::Code::MISSING_CPL_CONTENT_VERSION,
+ _id,
+ file
+ )
+ );
+ }
}
auto rating_list = f.node_child ("RatingList");
for (auto i: rating_list->node_children("Rating")) {