summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-07-08 21:13:06 +0100
committerCarl Hetherington <cth@carlh.net>2016-07-08 21:13:06 +0100
commit02cc8c7680381c123a31c23a43f6b34a04c2115a (patch)
tree5891c4c0954a05eaa538feb704cbc99e2ab1d05d /test
parent167cfacc7fe88f69fa433c46b62a54703ed6dca3 (diff)
Fix failure to analyse audio in some cases.
This fixes audio-only content when the first-emitted audio is not at time zero. This used to cause a seek which is not possible with audio-only. This commit removes the unnecessary seek which was due to missing silent-padding of the first-emitted audio.
Diffstat (limited to 'test')
-rw-r--r--test/audio_analysis_test.cc20
-rw-r--r--test/test.cc5
-rw-r--r--test/test.h2
3 files changed, 25 insertions, 2 deletions
diff --git a/test/audio_analysis_test.cc b/test/audio_analysis_test.cc
index 5923e0698..278ea06d9 100644
--- a/test/audio_analysis_test.cc
+++ b/test/audio_analysis_test.cc
@@ -32,6 +32,8 @@
#include "lib/ratio.h"
#include "lib/job_manager.h"
#include "lib/audio_content.h"
+#include "lib/content_factory.h"
+#include "lib/playlist.h"
#include "test.h"
using boost::shared_ptr;
@@ -168,3 +170,21 @@ BOOST_AUTO_TEST_CASE (audio_analysis_test3)
wait_for_jobs ();
BOOST_CHECK (done);
}
+
+/** Run an audio analysis that triggered an exception in the audio decoder at one point */
+BOOST_AUTO_TEST_CASE (analyse_audio_test4)
+{
+ shared_ptr<Film> 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");
+ shared_ptr<Content> content = content_factory (film, private_data / "20 The Wedding Convoy Song.m4a");
+ film->examine_and_add_content (content);
+ wait_for_jobs ();
+
+ shared_ptr<Playlist> playlist (new Playlist);
+ playlist->add (content);
+ boost::signals2::connection c;
+ JobManager::instance()->analyse_audio (film, playlist, c, boost::bind (&finished));
+ BOOST_CHECK (!wait_for_jobs ());
+}
diff --git a/test/test.cc b/test/test.cc
index c7a9e95bf..c57f76e61 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -291,7 +291,7 @@ check_xml (boost::filesystem::path ref, boost::filesystem::path test, list<strin
check_xml (ref_root, test_root, ignore);
}
-void
+bool
wait_for_jobs ()
{
JobManager* jm = JobManager::instance ();
@@ -322,7 +322,10 @@ wait_for_jobs ()
if (jm->errors ()) {
JobManager::drop ();
+ return true;
}
+
+ return false;
}
void
diff --git a/test/test.h b/test/test.h
index 2208929a9..1593b3a03 100644
--- a/test/test.h
+++ b/test/test.h
@@ -25,7 +25,7 @@ class Image;
extern boost::filesystem::path private_data;
-extern void wait_for_jobs ();
+extern bool wait_for_jobs ();
extern boost::shared_ptr<Film> new_test_film (std::string);
extern void check_dcp (boost::filesystem::path, boost::filesystem::path);
extern void check_file (boost::filesystem::path ref, boost::filesystem::path check);