X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Faudio_analysis_test.cc;h=5a9c753242ec2983a541294f9b7ab841f6a5a9fa;hb=f6a51c4902d6c1983d58e1073f048d50ba2a50df;hp=e131ce57c9cf331650302488f95d0dcce0adc183;hpb=39fb8198febde1937019db1c300ec363aab5aa56;p=dcpomatic.git diff --git a/test/audio_analysis_test.cc b/test/audio_analysis_test.cc index e131ce57c..5a9c75324 100644 --- a/test/audio_analysis_test.cc +++ b/test/audio_analysis_test.cc @@ -27,7 +27,6 @@ */ -#include "test.h" #include "lib/analyse_audio_job.h" #include "lib/audio_analysis.h" #include "lib/audio_content.h" @@ -39,12 +38,11 @@ #include "lib/job_manager.h" #include "lib/playlist.h" #include "lib/ratio.h" +#include "test.h" #include -#include using std::make_shared; -using std::shared_ptr; using std::vector; using namespace dcpomatic; @@ -188,14 +186,14 @@ BOOST_AUTO_TEST_CASE (analyse_audio_test4) film->set_container (Ratio::from_id ("185")); film->set_dcp_content_type (DCPContentType::from_isdcf_name("TLR")); film->set_name ("frobozz"); - auto content = content_factory(TestPaths::private_data() / "20 The Wedding Convoy Song.m4a").front(); + auto content = content_factory(TestPaths::private_data() / "20 The Wedding Convoy Song.m4a")[0]; film->examine_and_add_content (content); BOOST_REQUIRE (!wait_for_jobs()); auto playlist = make_shared(); playlist->add (film, content); boost::signals2::connection c; - JobManager::instance()->analyse_audio(film, playlist, false, c, []() {}); + JobManager::instance()->analyse_audio(film, playlist, false, c, [](Job::Result) {}); BOOST_CHECK (!wait_for_jobs ()); } @@ -204,14 +202,14 @@ BOOST_AUTO_TEST_CASE (analyse_audio_leqm_test) { auto film = new_test_film2 ("analyse_audio_leqm_test"); film->set_audio_channels (2); - auto content = content_factory(TestPaths::private_data() / "betty_stereo_48k.wav").front(); + auto content = content_factory(TestPaths::private_data() / "betty_stereo_48k.wav")[0]; film->examine_and_add_content (content); BOOST_REQUIRE (!wait_for_jobs()); auto playlist = make_shared(); playlist->add (film, content); boost::signals2::connection c; - JobManager::instance()->analyse_audio(film, playlist, false, c, []() {}); + JobManager::instance()->analyse_audio(film, playlist, false, c, [](Job::Result) {}); BOOST_CHECK (!wait_for_jobs()); AudioAnalysis analysis(film->audio_analysis_path(playlist)); @@ -219,3 +217,19 @@ BOOST_AUTO_TEST_CASE (analyse_audio_leqm_test) /* The CLI tool of leqm_nrt gives this value for betty_stereo_48k.wav */ BOOST_CHECK_CLOSE (analysis.leqm().get_value_or(0), 88.276, 0.001); } + + +/** Bug #2364; a file with a lot of silent video at the end (about 50s worth) + * crashed the audio analysis with an OOM on Windows. + */ +BOOST_AUTO_TEST_CASE(analyse_audio_with_long_silent_end) +{ + auto content = content_factory(TestPaths::private_data() / "2364.mkv")[0]; + auto film = new_test_film2("analyse_audio_with_long_silent_end", { content }); + + auto playlist = make_shared(); + playlist->add(film, content); + boost::signals2::connection c; + JobManager::instance()->analyse_audio(film, playlist, false, c, [](Job::Result) {}); + BOOST_CHECK(!wait_for_jobs()); +}