#include "lib/butler.h"
#include "lib/compose.hpp"
#include "lib/config.h"
+#include "lib/constants.h"
#include "lib/content_factory.h"
#include "lib/cross.h"
#include "lib/dcp_content.h"
check /= "black_fill_test";
check /= film->dcp_name();
- check_dcp (ref.string(), check.string());
+ /* This test is concerned with the image, so we'll ignore any
+ * differences in sound between the DCP and the reference to avoid test
+ * failures for unrelated reasons.
+ */
+ check_dcp(ref.string(), check.string(), true);
}
BOOST_AUTO_TEST_CASE(multiple_sound_files_bug)
{
+ Cleanup cl;
+
Config::instance()->set_log_types(Config::instance()->log_types() | LogEntry::TYPE_DEBUG_PLAYER);
auto A = content_factory(TestPaths::private_data() / "kook" / "1.wav").front();
auto B = content_factory(TestPaths::private_data() / "kook" / "2.wav").front();
auto C = content_factory(TestPaths::private_data() / "kook" / "3.wav").front();
- auto film = new_test_film2("multiple_sound_files_bug", { A, B, C });
+ auto film = new_test_film2("multiple_sound_files_bug", { A, B, C }, &cl);
+ film->set_audio_channels(16);
C->set_position(film, DCPTime(3840000));
make_and_verify_dcp(film, { dcp::VerificationNote::Code::MISSING_CPL_METADATA });
check_mxf_audio_file(TestPaths::private_data() / "kook" / "reference.mxf", dcp_file(film, "pcm_"));
+
+ cl.run();
}
auto A = content_factory("test/data/sine_16_48_440_10.wav").front();
auto B = content_factory("test/data/sine_16_44.1_440_10.wav").front();
auto film = new_test_film2("trimmed_sound_mix_bug_13", { A, B });
+ film->set_audio_channels(16);
A->set_position(film, DCPTime());
A->audio->set_gain(-12);
A->set_video_frame_rate(film, 24);
B->set_video_frame_rate(film, 24);
film->set_video_frame_rate(25);
+ film->set_audio_channels(16);
make_and_verify_dcp(film, { dcp::VerificationNote::Code::MISSING_CPL_METADATA });
check_mxf_audio_file("test/data/trimmed_sound_mix_bug_13_frame_rate_change.mxf", dcp_file(film, "pcm_"));
while (!player->pass()) {}
}
+
+BOOST_AUTO_TEST_CASE(unmapped_audio_does_not_raise_buffer_error)
+{
+ auto content = content_factory(TestPaths::private_data() / "arrietty_JP-EN.mkv")[0];
+ auto film = new_test_film2("unmapped_audio_does_not_raise_buffer_error", { content });
+
+ content->audio->set_mapping(AudioMapping(6 * 2, MAX_DCP_AUDIO_CHANNELS));
+
+ Player player(film, Image::Alignment::COMPACT);
+ Butler butler(film, player, AudioMapping(), 2, bind(PlayerVideo::force, AV_PIX_FMT_RGB24), VideoRange::FULL, Image::Alignment::PADDED, true, false, Butler::Audio::ENABLED);
+
+ /* Wait for the butler thread to run for a while; in the case under test it will throw an exception because
+ * the video buffers are filled but no audio comes.
+ */
+ dcpomatic_sleep_seconds(10);
+ butler.rethrow();
+}
+