diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-11-29 00:51:38 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-12-03 00:23:38 +0100 |
| commit | 8798bfab1539c3ac6031bb325e1b181c58b13fc5 (patch) | |
| tree | 9352ecbe44b970855513e85b7e24854b7628d87f /test | |
| parent | 5000e8b9dfe2807926e8fe1cb2dfc42ca319c7f6 (diff) | |
Obey audio timestamps if they don't deviate by more than some threshold.
Previously we would ignore audio timestamps because they are not
contiguous in a sample-accurate way.
However with bugs like #1833 we do need to obey large discontinuities
in audio timestamps, otherwise we get large sync errors.
Here we change timestamp handling to ignore small discontinuities
in timestamps but not larger ones.
Diffstat (limited to 'test')
| -rw-r--r-- | test/content_test.cc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/content_test.cc b/test/content_test.cc index 23fb23865..de9ca7774 100644 --- a/test/content_test.cc +++ b/test/content_test.cc @@ -23,6 +23,7 @@ * @ingroup completedcp */ +#include "lib/audio_content.h" #include "lib/film.h" #include "lib/dcp_content_type.h" #include "lib/content_factory.h" @@ -150,3 +151,28 @@ BOOST_AUTO_TEST_CASE (content_test5) audio->set_trim_end (dcpomatic::ContentTime(3000)); BOOST_CHECK (audio->length_after_trim(film) == DCPTime(957000)); } + + +/** Sync error #1833 */ +BOOST_AUTO_TEST_CASE (content_test6) +{ + shared_ptr<Film> film = new_test_film2 ("content_test6"); + film->examine_and_add_content (content_factory(TestPaths::private_data() / "fha.mkv").front()); + BOOST_REQUIRE (!wait_for_jobs()); + film->make_dcp (); + BOOST_REQUIRE (!wait_for_jobs()); + check_dcp (TestPaths::private_data() / "fha", film); +} + + +/** Reel length error when making the test for #1833 */ +BOOST_AUTO_TEST_CASE (content_test7) +{ + shared_ptr<Film> film = new_test_film2 ("content_test7"); + shared_ptr<Content> content = content_factory(TestPaths::private_data() / "clapperboard.mp4").front(); + film->examine_and_add_content (content); + BOOST_REQUIRE (!wait_for_jobs()); + content->audio->set_delay (-1000); + film->make_dcp (); + BOOST_REQUIRE (!wait_for_jobs()); +} |
