Sort notes when checking verifications.
[libdcp.git] / src / verify.cc
index c9d9b24d04e6081663490b77f6d67de1011c836c..623794cc9c276684bc00c5f9a97562726d4d0841 100644 (file)
@@ -1131,7 +1131,7 @@ dcp::verify (
                stage ("Checking DCP", dcp->directory());
                bool carry_on = true;
                try {
-                       dcp->read (&notes);
+                       dcp->read (&notes, true);
                } catch (MissingAssetmapError& e) {
                        notes.push_back ({VerificationNote::Type::ERROR, VerificationNote::Code::FAILED_READ, string(e.what())});
                        carry_on = false;
@@ -1472,6 +1472,8 @@ dcp::note_to_string (VerificationNote note)
                return String::compose("The instantaneous bit rate of the picture asset %1 is close to the limit of 250Mbit/s in at least one place.", note.file()->filename());
        case VerificationNote::Code::EXTERNAL_ASSET:
                return String::compose("The asset %1 that this DCP refers to is not included in the DCP.  It may be a VF.", note.note().get());
+       case VerificationNote::Code::THREED_ASSET_MARKED_AS_TWOD:
+               return String::compose("The asset %1 is 3D but its MXF is marked as 2D.", note.file()->filename());
        case VerificationNote::Code::INVALID_STANDARD:
                return "This DCP does not use the SMPTE standard.";
        case VerificationNote::Code::INVALID_LANGUAGE:
@@ -1616,6 +1618,29 @@ dcp::operator== (dcp::VerificationNote const& a, dcp::VerificationNote const& b)
 }
 
 
+bool
+dcp::operator< (dcp::VerificationNote const& a, dcp::VerificationNote const& b)
+{
+       if (a.type() != b.type()) {
+               return a.type() < b.type();
+       }
+
+       if (a.code() != b.code()) {
+               return a.code() < b.code();
+       }
+
+       if (a.note() != b.note()) {
+               return a.note().get_value_or("") < b.note().get_value_or("");
+       }
+
+       if (a.file() != b.file()) {
+               return a.file().get_value_or("") < b.file().get_value_or("");
+       }
+
+       return a.line().get_value_or(0) < b.line().get_value_or(0);
+}
+
+
 std::ostream&
 dcp::operator<< (std::ostream& s, dcp::VerificationNote const& note)
 {