summaryrefslogtreecommitdiff
path: root/src/pkl.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-09-23 23:42:58 +0200
committerCarl Hetherington <cth@carlh.net>2024-09-23 23:42:58 +0200
commit152266f6e65451a03521eb04b6a406b6e309e17a (patch)
tree0ebf358010ba72fdec87e8c64bdceea5a05b2925 /src/pkl.cc
parentadae04e0984d294aa9a95394bfed584ce7e93469 (diff)
Allow but give an error when seeing a strange PKL namespace.v1.8.110
DoM bug #2868 reports that Resolve made a DCP with the PKL namespace http://www.smpte-ra.org/schemas/2067-2/2016/PKL This seems wrong (google suggests that this is the namespace for IMF PKLs) but let's accept it and log an error instead of throwing an exception.
Diffstat (limited to 'src/pkl.cc')
-rw-r--r--src/pkl.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/pkl.cc b/src/pkl.cc
index 57eda9da..1684ea5f 100644
--- a/src/pkl.cc
+++ b/src/pkl.cc
@@ -44,6 +44,7 @@
#include "raw_convert.h"
#include "util.h"
#include "warnings.h"
+#include "verify.h"
LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
LIBDCP_ENABLE_WARNINGS
@@ -53,15 +54,18 @@ LIBDCP_ENABLE_WARNINGS
using std::string;
using std::shared_ptr;
using std::make_shared;
+using std::vector;
using boost::optional;
using namespace dcp;
static string const pkl_interop_ns = "http://www.digicine.com/PROTO-ASDCP-PKL-20040311#";
static string const pkl_smpte_ns = "http://www.smpte-ra.org/schemas/429-8/2007/PKL";
+/* I don't know why Resolve are using this namespace but apparently they are */
+static string const pkl_resolve_smpte_ns = "http://www.smpte-ra.org/schemas/2067-2/2016/PKL";
-PKL::PKL (boost::filesystem::path file)
+PKL::PKL(boost::filesystem::path file, vector<dcp::VerificationNote>* notes)
: _file (file)
{
cxml::Document pkl ("PackingList");
@@ -71,6 +75,18 @@ PKL::PKL (boost::filesystem::path file)
_standard = Standard::INTEROP;
} else if (pkl.namespace_uri() == pkl_smpte_ns) {
_standard = Standard::SMPTE;
+ } else if (pkl.namespace_uri() == pkl_resolve_smpte_ns) {
+ _standard = Standard::SMPTE;
+ if (notes) {
+ notes->push_back(
+ dcp::VerificationNote(
+ dcp::VerificationNote::Type::ERROR,
+ dcp::VerificationNote::Code::INVALID_PKL_NAMESPACE,
+ pkl.namespace_uri(),
+ file
+ )
+ );
+ }
} else {
boost::throw_exception(XMLError("Unrecognised packing list namespace " + pkl.namespace_uri()));
}