summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-01-03 00:31:40 +0100
committerCarl Hetherington <cth@carlh.net>2021-01-17 20:13:22 +0100
commitf11ff8d4d961d92e994ef0f9beb456aa8ec7c4cb (patch)
treefa69fd7a044bbf02a7971da6434373eb18c83edb /src
parente182156f75a74457c4452cc3bfe91d778d0d7148 (diff)
Bv2.1 7.2.3: Check that subtitle <StartTime> exists and is 0.
Diffstat (limited to 'src')
-rw-r--r--src/verify.cc16
-rw-r--r--src/verify.h4
2 files changed, 20 insertions, 0 deletions
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 <Language> tag, which is required by Bv2.1", note.file()->filename());
case dcp::VerificationNote::SUBTITLE_LANGUAGES_DIFFER:
return String::compose("Some subtitle assets have different <Language> 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 <StartTime> 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 <StartTime> 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 <Language> tag [Bv2.1_7.2.2] */
SUBTITLE_LANGUAGES_DIFFER,
+ /** Some SMPTE subtitle XML has no <StartTime> tag [Bv2.1_7.2.3] */
+ MISSING_SUBTITLE_START_TIME,
+ /** Some SMPTE subtitle XML has a non-zero <StartTime> tag [Bv2.1_7.2.3] */
+ SUBTITLE_START_TIME_NON_ZERO,
};
VerificationNote (Type type, Code code)