summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-01-15 23:13:49 +0100
committerCarl Hetherington <cth@carlh.net>2023-01-15 23:14:00 +0100
commit4c0e03e857066a8241bfb286412f76a8c52d2760 (patch)
tree3dd738b666d0b7118f225981d76a66f70620cf46 /src
parent7b6965584cd81ee0406901d84b769946483a85b6 (diff)
Check that Interop subtitle files have at least one subtitle.
It was reported on the forum that files without any <Font> or <Subtitle> tags fail validation on EasyDCP 3.0.1 and crash Qubemaster Pro 3.0.15.
Diffstat (limited to 'src')
-rw-r--r--src/verify.cc17
-rw-r--r--src/verify.h7
2 files changed, 23 insertions, 1 deletions
diff --git a/src/verify.cc b/src/verify.cc
index bfa697da..8ea9ae97 100644
--- a/src/verify.cc
+++ b/src/verify.cc
@@ -687,6 +687,16 @@ verify_smpte_timed_text_asset (
}
+/** Verify Interop subtitle-only stuff */
+void
+verify_interop_subtitle_asset(shared_ptr<const InteropSubtitleAsset> asset, vector<VerificationNote>& notes)
+{
+ if (asset->subtitles().empty()) {
+ notes.push_back({VerificationNote::Type::ERROR, VerificationNote::Code::MISSING_SUBTITLE, asset->id(), asset->file().get() });
+ }
+}
+
+
/** Verify SMPTE subtitle-only stuff */
void
verify_smpte_subtitle_asset (
@@ -740,6 +750,11 @@ verify_subtitle_asset (
notes.push_back ({VerificationNote::Type::WARNING, VerificationNote::Code::MISSED_CHECK_OF_ENCRYPTED});
}
+ auto interop = dynamic_pointer_cast<const InteropSubtitleAsset>(asset);
+ if (interop) {
+ verify_interop_subtitle_asset(interop, notes);
+ }
+
auto smpte = dynamic_pointer_cast<const SMPTESubtitleAsset>(asset);
if (smpte) {
verify_smpte_timed_text_asset (smpte, reel_asset_duration, notes);
@@ -1938,6 +1953,8 @@ dcp::note_to_string (VerificationNote note)
return String::compose("The PKL %1 has more than one asset with the same ID", note.note().get());
case VerificationNote::Code::DUPLICATE_ASSET_ID_IN_ASSETMAP:
return String::compose("The ASSETMAP %1 has more than one asset with the same ID", note.note().get());
+ case VerificationNote::Code::MISSING_SUBTITLE:
+ return String::compose("The subtitle asset %1 has no subtitles", note.note().get());
}
return "";
diff --git a/src/verify.h b/src/verify.h
index e9b5c9d0..2e20bc31 100644
--- a/src/verify.h
+++ b/src/verify.h
@@ -410,7 +410,12 @@ public:
* note contains the ASSETMAP ID
* file contains the ASSETMAP filename
*/
- DUPLICATE_ASSET_ID_IN_ASSETMAP
+ DUPLICATE_ASSET_ID_IN_ASSETMAP,
+ /** An Interop subtitle asset has no subtitles.
+ * note contains the asset ID
+ * file contains the asset filename
+ */
+ MISSING_SUBTITLE
};
VerificationNote (Type type, Code code)