+
+
+/** Run an audio analysis that triggered an exception in the audio decoder at one point */
+BOOST_AUTO_TEST_CASE (analyse_audio_test4)
+{
+ auto film = new_test_film ("analyse_audio_test");
+ 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();
+ film->examine_and_add_content (content);
+ BOOST_REQUIRE (!wait_for_jobs());
+
+ auto playlist = make_shared<Playlist>();
+ playlist->add (film, content);
+ boost::signals2::connection c;
+ JobManager::instance()->analyse_audio(film, playlist, false, c, []() {});
+ BOOST_CHECK (!wait_for_jobs ());
+}
+
+
+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();
+ film->examine_and_add_content (content);
+ BOOST_REQUIRE (!wait_for_jobs());
+
+ auto playlist = make_shared<Playlist>();
+ playlist->add (film, content);
+ boost::signals2::connection c;
+ JobManager::instance()->analyse_audio(film, playlist, false, c, []() {});
+ BOOST_CHECK (!wait_for_jobs());
+
+ AudioAnalysis analysis(film->audio_analysis_path(playlist));
+
+ /* 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);
+}