summaryrefslogtreecommitdiff
path: root/test/subtitle_reel_test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-04-12 22:25:04 +0200
committerCarl Hetherington <cth@carlh.net>2025-04-12 22:25:04 +0200
commit19f1a934c9e3531da3bd95cdc854f491ee14e215 (patch)
tree93d473ae0c7edee05fe9ced05a1fa265ea27fdbb /test/subtitle_reel_test.cc
parent2b38754e56ded471019ef910fb9c9a579fe5e1d9 (diff)
Fix case where -ve duration subtitles could be created at reel boundaries (#3012)
Diffstat (limited to 'test/subtitle_reel_test.cc')
-rw-r--r--test/subtitle_reel_test.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/subtitle_reel_test.cc b/test/subtitle_reel_test.cc
index 877709f73..d72a543fd 100644
--- a/test/subtitle_reel_test.cc
+++ b/test/subtitle_reel_test.cc
@@ -234,3 +234,28 @@ BOOST_AUTO_TEST_CASE (subtitles_split_at_reel_boundaries)
}
}
+
+BOOST_AUTO_TEST_CASE(bad_subtitle_not_created_at_reel_boundaries)
+{
+ boost::filesystem::path const srt = "build/test/bad_subtitle_not_created_at_reel_boundaries.srt";
+ dcp::write_string_to_file("1\n00:00:10,000 -> 00:00:20,000\nHello world", srt);
+ auto content = content_factory(srt)[0];
+
+ auto film = new_test_film("bad_subtitle_not_created_at_reel_boundaries", { content });
+ film->set_reel_type(ReelType::CUSTOM);
+ content->text[0]->set_language(dcp::LanguageTag("de-DE"));
+ /* This is 1 frame after the start of the subtitle */
+ film->set_custom_reel_boundaries({dcpomatic::DCPTime::from_frames(241, 24)});
+
+ /* This is a tricky situation and the way DoM deals with it gives two Bv2.1
+ * warnings, but these are "should" not "shall" so I think it's OK.
+ */
+ make_and_verify_dcp(
+ film,
+ {
+ dcp::VerificationNote::Code::MISSING_CPL_METADATA,
+ dcp::VerificationNote::Code::INVALID_SUBTITLE_DURATION,
+ dcp::VerificationNote::Code::INVALID_SUBTITLE_SPACING,
+ });
+}
+