From e617a3f8073fbf8d1d9ef01b57e866dd41978b87 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 9 Mar 2020 21:06:53 +0100 Subject: Give an error if there is no asset map. --- src/verify.cc | 11 ++++++++--- src/verify.h | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/verify.cc b/src/verify.cc index ca53a4c1..c91257be 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -431,9 +431,12 @@ dcp::verify ( validate_xml (pkl->file().get(), xsd_dtd_directory, notes); } - stage ("Checking ASSETMAP", dcp->asset_map_path().get()); - validate_xml (dcp->asset_map_path().get(), xsd_dtd_directory, notes); - + if (dcp->asset_map_path()) { + stage ("Checking ASSETMAP", dcp->asset_map_path().get()); + validate_xml (dcp->asset_map_path().get(), xsd_dtd_directory, notes); + } else { + notes.push_back (VerificationNote(VerificationNote::VERIFY_ERROR, VerificationNote::MISSING_ASSETMAP)); + } } return notes; @@ -465,6 +468,8 @@ dcp::note_to_string (dcp::VerificationNote note) return "The DCP contains both SMPTE and Interop parts."; case dcp::VerificationNote::XML_VALIDATION_ERROR: return String::compose("An XML file is badly formed: %1 (%2:%3)", note.note().get(), note.file()->filename(), note.line().get()); + case dcp::VerificationNote::MISSING_ASSETMAP: + return "No ASSETMAP or ASSETMAP.xml was found"; } return ""; diff --git a/src/verify.h b/src/verify.h index ab9e9aac..89069bdd 100644 --- a/src/verify.h +++ b/src/verify.h @@ -77,6 +77,8 @@ public: MISMATCHED_STANDARD, /** Some XML fails to validate against the XSD/DTD */ XML_VALIDATION_ERROR, + /** No ASSETMAP{.xml} was found */ + MISSING_ASSETMAP }; VerificationNote (Type type, Code code) -- cgit v1.2.3