Merge.
[libdcp.git] / src / verify.cc
index a8c5001c1fe73bffde37b9b6e7dd5c79707b0338..66cd25e4e4f05605b71a4400f918a1c3f2653c14 100644 (file)
@@ -448,9 +448,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;
@@ -482,6 +485,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";
        case dcp::VerificationNote::INTRINSIC_DURATION_TOO_SMALL:
                return String::compose("The intrinsic duration of an asset is less than 1 second long: %1", note.note().get());
        case dcp::VerificationNote::DURATION_TOO_SMALL: