, _stream (stream)
, _decoder (decoder)
, _log (log)
+ /* We effectively start having done a seek to zero; this allows silence-padding of the first
+ data that comes out of our decoder.
+ */
+ , _seek_reference (ContentTime ())
{
if (content->resampled_frame_rate() != _stream->frame_rate() && _stream->channels() > 0) {
_resampler.reset (new Resampler (_stream->frame_rate(), content->resampled_frame_rate(), _stream->channels ()));
class Film;
class Playlist;
-extern void wait_for_jobs ();
+extern bool wait_for_jobs ();
/** @class JobManager
* @brief A simple scheduler for jobs.
private:
/* This function is part of the test suite */
- friend void ::wait_for_jobs ();
+ friend bool ::wait_for_jobs ();
JobManager ();
~JobManager ();
#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;
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 ());
+}
check_xml (ref_root, test_root, ignore);
}
-void
+bool
wait_for_jobs ()
{
JobManager* jm = JobManager::instance ();
if (jm->errors ()) {
JobManager::drop ();
+ return true;
}
+
+ return false;
}
void
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);