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>
Mon, 15 Apr 2024 08:59:34 +0000 (10:59 +0200)
src/verify.cc
src/verify.h

index 9756f9c7f0536d08a7d9da8c3d505fa6c8a4dace..d5229202b96f528644487d30faa97587b0593ca3 100644 (file)
@@ -1575,14 +1575,19 @@ verify_cpl(Context& context, shared_ptr<const CPL> 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") {
                                        context.bv21_error(VerificationNote::Code::INVALID_LANGUAGE, terr);
+                                       valid = false;
                                }
                        }
+                       if (valid) {
+                               context.ok(VerificationNote::Code::VALID_RELEASE_TERRITORY, terr);
+                       }
                }
        }
 
@@ -1980,6 +1985,8 @@ dcp::note_to_string (VerificationNote note)
                return "This DCP does not use the SMPTE standard.";
        case VerificationNote::Code::INVALID_LANGUAGE:
                return String::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 String::compose("Valid release territory %1.", note.note().get());
        case VerificationNote::Code::INVALID_PICTURE_SIZE_IN_PIXELS:
                return String::compose("The size %1 of picture asset %2 is not allowed.", note.note().get(), note.file()->filename());
        case VerificationNote::Code::INVALID_PICTURE_FRAME_RATE_FOR_2K:
index 339f418666152ed7d130996be2b433402e199f2a..e59371b8969b4ef27412e526a65eca1faad7a01c 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