X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Faudio_decoder_test.cc;h=57852dcb981b57070a4dc3a0f372a68c76899956;hb=6c98bac6ec242f8113a23b29a00f740a0ffa1129;hp=92c99a378065389c800ba459682ecb6e785d8983;hpb=5a5324ed3a381a86dfe0a6e3932c1d58fdcd596f;p=dcpomatic.git diff --git a/test/audio_decoder_test.cc b/test/audio_decoder_test.cc index 92c99a378..57852dcb9 100644 --- a/test/audio_decoder_test.cc +++ b/test/audio_decoder_test.cc @@ -26,9 +26,11 @@ #include "lib/content.h" #include "lib/audio_decoder.h" #include "lib/audio_content.h" +#include "lib/content_factory.h" +#include "lib/dcp_content_type.h" +#include "lib/ratio.h" #include "lib/film.h" #include -#include #include #include @@ -36,7 +38,6 @@ using std::string; using std::cout; using std::min; using boost::shared_ptr; -using boost::make_shared; class TestAudioContent : public Content { @@ -68,7 +69,7 @@ public: : _test_audio_content (content) , _position (0) { - audio.reset (new AudioDecoder (this, content->audio, false, log)); + audio.reset (new AudioDecoder (this, content->audio, log)); } bool pass (PassReason, bool) @@ -78,7 +79,7 @@ public: _test_audio_content->audio_length() - _position ); - shared_ptr buffers = make_shared (_test_audio_content->audio->stream()->channels(), N); + shared_ptr buffers (new AudioBuffers (_test_audio_content->audio->stream()->channels(), N)); for (int i = 0; i < _test_audio_content->audio->stream()->channels(); ++i) { for (int j = 0; j < N; ++j) { buffers->data(i)[j] = j + _position; @@ -151,3 +152,18 @@ BOOST_AUTO_TEST_CASE (audio_decoder_get_audio_test) } } } + +BOOST_AUTO_TEST_CASE (audio_decoder_test) +{ + shared_ptr 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_factory(film, private_data / "20 The Wedding Convoy Song.m4a").front(); + film->examine_and_add_content (content); + wait_for_jobs (); + + content->set_trim_start (ContentTime::from_seconds (60)); + film->make_dcp (); + BOOST_CHECK (!wait_for_jobs ()); +}