/*
- Copyright (C) 2014-2018 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-2019 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
shared_ptr<Butler> butler (new Butler(player, AudioMapping(), 6, bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), false, true));
/* Wait for the butler to fill */
- dcpomatic_sleep (5);
+ dcpomatic_sleep_seconds (5);
boon->set_trim_start (ContentTime::from_seconds(5));
butler->seek (DCPTime(), true);
/* Wait for the butler to refill */
- dcpomatic_sleep (5);
+ dcpomatic_sleep_seconds (5);
butler->rethrow ();
}
+
+/** Test a crash when the gap between the last audio and the start of a silent period is more than 1 sample */
+BOOST_AUTO_TEST_CASE (player_silence_crash)
+{
+ shared_ptr<Film> film = new_test_film2 ("player_silence_crash");
+ shared_ptr<Content> sine = content_factory("test/data/impulse_train.wav").front();
+ film->examine_and_add_content (sine);
+ BOOST_REQUIRE (!wait_for_jobs());
+
+ sine->set_video_frame_rate (23.976);
+ film->write_metadata ();
+ film->make_dcp ();
+ BOOST_REQUIRE (!wait_for_jobs());
+}