From f11ff8d4d961d92e994ef0f9beb456aa8ec7c4cb Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 3 Jan 2021 00:31:40 +0100 Subject: Bv2.1 7.2.3: Check that subtitle exists and is 0. --- src/verify.cc | 16 ++++++++++++++++ src/verify.h | 4 ++++ 2 files changed, 20 insertions(+) (limited to 'src') diff --git a/src/verify.cc b/src/verify.cc index 0b7def3c..bbae1ba4 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -704,6 +704,18 @@ verify_subtitle_asset ( ) ); } + + if (!smpte->start_time()) { + notes.push_back ( + VerificationNote( + VerificationNote::VERIFY_BV21_ERROR, VerificationNote::MISSING_SUBTITLE_START_TIME, *asset->file()) + ); + } else if (smpte->start_time() != dcp::Time()) { + notes.push_back ( + VerificationNote( + VerificationNote::VERIFY_BV21_ERROR, VerificationNote::SUBTITLE_START_TIME_NON_ZERO, *asset->file()) + ); + } } } @@ -912,6 +924,10 @@ dcp::note_to_string (dcp::VerificationNote note) return String::compose("The XML for a SMPTE subtitle asset has no tag, which is required by Bv2.1", note.file()->filename()); case dcp::VerificationNote::SUBTITLE_LANGUAGES_DIFFER: return String::compose("Some subtitle assets have different tags than others", note.file()->filename()); + case dcp::VerificationNote::MISSING_SUBTITLE_START_TIME: + return String::compose("The XML for a SMPTE subtitle asset has no tag, which is required by Bv2.1", note.file()->filename()); + case dcp::VerificationNote::SUBTITLE_START_TIME_NON_ZERO: + return String::compose("The XML for a SMPTE subtitle asset has a non-zero tag, which is disallowed by Bv2.1", note.file()->filename()); } return ""; diff --git a/src/verify.h b/src/verify.h index 170aeb8b..2957654f 100644 --- a/src/verify.h +++ b/src/verify.h @@ -112,6 +112,10 @@ public: MISSING_SUBTITLE_LANGUAGE, /** Not all subtitle assets specify the same tag [Bv2.1_7.2.2] */ SUBTITLE_LANGUAGES_DIFFER, + /** Some SMPTE subtitle XML has no tag [Bv2.1_7.2.3] */ + MISSING_SUBTITLE_START_TIME, + /** Some SMPTE subtitle XML has a non-zero tag [Bv2.1_7.2.3] */ + SUBTITLE_START_TIME_NON_ZERO, }; VerificationNote (Type type, Code code) -- cgit v1.2.3