Bv2.1 8.1: CPL <AnnotationText> should be the same as <ContentTitleText>
authorCarl Hetherington <cth@carlh.net>
Thu, 14 Jan 2021 21:50:09 +0000 (22:50 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 17 Jan 2021 19:13:23 +0000 (20:13 +0100)
src/verify.cc
src/verify.h
test/verify_test.cc

index 56ef21c9b14ebe460e786bae72eab2ac77016975..44b3b657fc92ff32f9b140779b820244c290df8f 100644 (file)
@@ -1026,8 +1026,12 @@ dcp::verify (
                                verify_language_tag (cpl->release_territory().get(), notes);
                        }
 
-                       if (dcp->standard() == dcp::SMPTE && !cpl->annotation_text()) {
-                               notes.push_back (VerificationNote(VerificationNote::VERIFY_BV21_ERROR, VerificationNote::MISSING_ANNOTATION_TEXT_IN_CPL));
+                       if (dcp->standard() == dcp::SMPTE) {
+                               if (!cpl->annotation_text()) {
+                                       notes.push_back (VerificationNote(VerificationNote::VERIFY_BV21_ERROR, VerificationNote::MISSING_ANNOTATION_TEXT_IN_CPL));
+                               } else if (cpl->annotation_text().get() != cpl->content_title_text()) {
+                                       notes.push_back (VerificationNote(VerificationNote::VERIFY_WARNING, VerificationNote::CPL_ANNOTATION_TEXT_DIFFERS_FROM_CONTENT_TITLE_TEXT));
+                               }
                        }
 
                        /* Check that the CPL's hash corresponds to the PKL */
@@ -1225,6 +1229,8 @@ dcp::note_to_string (dcp::VerificationNote note)
                return "A sound asset has a sampling rate other than 48kHz, which is disallowed by Bv2.1";
        case dcp::VerificationNote::MISSING_ANNOTATION_TEXT_IN_CPL:
                return "The CPL has no <AnnotationText> tag, which is required by Bv2.1";
+       case dcp::VerificationNote::CPL_ANNOTATION_TEXT_DIFFERS_FROM_CONTENT_TITLE_TEXT:
+               return "The CPL's <AnnotationText> differs from its <ContentTitleText>, which Bv2.1 advises against.";
        }
 
        return "";
index 8ee7e1ef8e5fdc6bc77d8aa9e3b9f845e944ad89..cab8ba4f9048706d833729bed85900e2909c821e 100644 (file)
@@ -135,6 +135,8 @@ public:
                INVALID_SOUND_FRAME_RATE,
                /** The CPL has no <AnnotationText> tag [Bv2.1_8.1] */
                MISSING_ANNOTATION_TEXT_IN_CPL,
+               /** The <AnnotationText> is not the same as the <ContentTitleText> [Bv2.1_8.1] */
+               CPL_ANNOTATION_TEXT_DIFFERS_FROM_CONTENT_TITLE_TEXT,
        };
 
        VerificationNote (Type type, Code code)
index 98a28cbc3635d960b0f39478612b9a342a9750c4..6ed6b092333d73e2157462cc11d2aa54e237efc2 100644 (file)
@@ -1651,3 +1651,25 @@ BOOST_AUTO_TEST_CASE (verify_cpl_must_have_annotation_text)
                });
 }
 
+
+BOOST_AUTO_TEST_CASE (verify_cpl_annotation_text_should_be_same_as_content_title_text)
+{
+       boost::filesystem::path const dir("build/test/verify_cpl_annotation_text_should_be_same_as_content_title_text");
+       auto dcp = make_simple (dir);
+       dcp->write_xml (dcp::SMPTE);
+       BOOST_REQUIRE_EQUAL (dcp->cpls().size(), 1U);
+
+       {
+               BOOST_REQUIRE (dcp->cpls()[0]->file());
+               Editor e(dcp->cpls()[0]->file().get());
+               e.replace("<AnnotationText>A Test DCP</AnnotationText>", "<AnnotationText>A Test DCP 1</AnnotationText>");
+       }
+
+       check_verify_result (
+               {dir},
+               {
+                       { dcp::VerificationNote::VERIFY_WARNING, dcp::VerificationNote::CPL_ANNOTATION_TEXT_DIFFERS_FROM_CONTENT_TITLE_TEXT },
+                       { dcp::VerificationNote::VERIFY_ERROR, dcp::VerificationNote::CPL_HASH_INCORRECT }
+               });
+}
+