Add OK note when release territory is valid.
authorCarl Hetherington <cth@carlh.net>
Sun, 7 Jan 2024 23:20:27 +0000 (00:20 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 14 Apr 2024 15:21:15 +0000 (17:21 +0200)
src/verify.cc
src/verify.h

index 028685186a05f2ec71cab0e00e64ae08c4deaa1d..a14f5446aa8297674847f7e3804e80af1ab9f7e1 100644 (file)
@@ -1591,14 +1591,19 @@ verify_cpl(
        if (cpl->release_territory()) {
                if (!cpl->release_territory_scope() || cpl->release_territory_scope().get() != "http://www.smpte-ra.org/schemas/429-16/2014/CPL-Metadata#scope/release-territory/UNM49") {
                        auto terr = cpl->release_territory().get();
+                       bool valid = true;
                        /* Must be a valid region tag, or "001" */
                        try {
                                LanguageTag::RegionSubtag test(terr);
                        } catch (...) {
                                if (terr != "001") {
                                        notes.push_back({VerificationNote::Type::BV21_ERROR, VerificationNote::Code::INVALID_LANGUAGE, terr});
+                                       valid = false;
                                }
                        }
+                       if (valid) {
+                               context.ok(VerificationNote::Code::VALID_RELEASE_TERRITORY, terr);
+                       }
                }
        }
 
@@ -2029,6 +2034,8 @@ dcp::note_to_string(VerificationNote note, function<string (string)> process_str
                return "This DCP does not use the SMPTE standard.";
        case VerificationNote::Code::INVALID_LANGUAGE:
                return compose("The DCP specifies a language '%1' which does not conform to the RFC 5646 standard.", note.note().get());
+       case VerificationNote::Code::VALID_RELEASE_TERRITORY:
+               return compose("Valid release territory %1.", note.note().get());
        case VerificationNote::Code::INVALID_PICTURE_SIZE_IN_PIXELS:
                return compose("The size %1 of picture asset %2 is not allowed.", note.note().get(), filename());
        case VerificationNote::Code::INVALID_PICTURE_FRAME_RATE_FOR_2K:
index 13a060b4d1e760e30121e932f5204b49e3c7e2e1..4947c5c2eba80d81ad9ebd21c7833331d7992da4 100644 (file)
@@ -182,6 +182,7 @@ public:
                 *  note contains the invalid language
                 */
                INVALID_LANGUAGE,
+               VALID_RELEASE_TERRITORY,
                /** A picture asset does not have one of the required Bv2.1 sizes (in pixels) [Bv2.1_7.1]
                 *  note contains the incorrect size as "<width>x<height>"
                 *  file contains the asset filename