From cb9fe95c4fee9d97c88d3f044cceb514fa753abb Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 14 Jan 2021 22:50:09 +0100 Subject: Bv2.1 8.1: CPL should be the same as --- src/verify.cc | 10 ++++++++-- src/verify.h | 2 ++ test/verify_test.cc | 22 ++++++++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/verify.cc b/src/verify.cc index 56ef21c9..44b3b657 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -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 tag, which is required by Bv2.1"; + case dcp::VerificationNote::CPL_ANNOTATION_TEXT_DIFFERS_FROM_CONTENT_TITLE_TEXT: + return "The CPL's differs from its , which Bv2.1 advises against."; } return ""; diff --git a/src/verify.h b/src/verify.h index 8ee7e1ef..cab8ba4f 100644 --- a/src/verify.h +++ b/src/verify.h @@ -135,6 +135,8 @@ public: INVALID_SOUND_FRAME_RATE, /** The CPL has no tag [Bv2.1_8.1] */ MISSING_ANNOTATION_TEXT_IN_CPL, + /** The is not the same as the [Bv2.1_8.1] */ + CPL_ANNOTATION_TEXT_DIFFERS_FROM_CONTENT_TITLE_TEXT, }; VerificationNote (Type type, Code code) diff --git a/test/verify_test.cc b/test/verify_test.cc index 98a28cbc..6ed6b092 100644 --- a/test/verify_test.cc +++ b/test/verify_test.cc @@ -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("A Test DCP", "A Test DCP 1"); + } + + 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 } + }); +} + -- cgit v1.2.3