diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-03-15 19:21:42 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-03-15 19:21:42 +0100 |
| commit | a8f48589d3eaec9de5bfd34f45410f88ab836363 (patch) | |
| tree | 2be043ae1a4c8e8e4b14ccc0945b7b268f2971ce | |
| parent | 78e7acd34725067d1e47e3f8676127934ee04b0f (diff) | |
Add failing test for #1918.
| m--------- | test/data | 0 | ||||
| -rw-r--r-- | test/subtitle_reel_test.cc | 39 |
2 files changed, 39 insertions, 0 deletions
diff --git a/test/data b/test/data -Subproject c9df3856b3022e9cc7e052cda2b2de9db186ec9 +Subproject c488ee62e04b03b915dac49a258bd13d64f281e diff --git a/test/subtitle_reel_test.cc b/test/subtitle_reel_test.cc index e56f9664a..d75c8af1a 100644 --- a/test/subtitle_reel_test.cc +++ b/test/subtitle_reel_test.cc @@ -190,3 +190,42 @@ BOOST_AUTO_TEST_CASE (closed_captions_in_all_reels_test) ); } } + + +BOOST_AUTO_TEST_CASE (subtitles_split_at_reel_boundaries) +{ + auto film = new_test_film2 ("subtitles_split_at_reel_boundaries"); + film->set_interop (true); + + film->set_sequence (false); + film->set_reel_type (ReelType::BY_VIDEO_CONTENT); + + for (int i = 0; i < 3; ++i) { + auto video = content_factory("test/data/flat_red.png").front(); + film->examine_and_add_content (video); + BOOST_REQUIRE (!wait_for_jobs()); + video->video->set_length (15 * 24); + video->set_position (film, dcpomatic::DCPTime::from_seconds(15 * i)); + } + + auto subtitle = content_factory("test/data/45s.srt").front(); + film->examine_and_add_content (subtitle); + BOOST_REQUIRE (!wait_for_jobs()); + + make_and_verify_dcp (film, {{ dcp::VerificationNote::Code::INVALID_STANDARD }}); + + dcp::DCP dcp (film->dir(film->dcp_name())); + dcp.read(); + BOOST_REQUIRE_EQUAL (dcp.cpls().size(), 1); + auto cpl = dcp.cpls()[0]; + BOOST_REQUIRE_EQUAL (cpl->reels().size(), 3); + + for (auto i: cpl->reels()) { + auto reel_sub = i->main_subtitle(); + BOOST_REQUIRE (reel_sub); + auto sub = reel_sub->asset(); + BOOST_REQUIRE (sub); + BOOST_CHECK_EQUAL (sub->subtitles().size(), 1); + } +} + |
