{
/* Check that we have a big enough buffer */
BOOST_CHECK (audio->frames() * audio->channels() < ref_buffer_size);
{
/* Check that we have a big enough buffer */
BOOST_CHECK (audio->frames() * audio->channels() < ref_buffer_size);
film->examine_and_add_content (c);
BOOST_REQUIRE (!wait_for_jobs());
film->write_metadata ();
/* See if can make a DCP without any errors */
film->examine_and_add_content (c);
BOOST_REQUIRE (!wait_for_jobs());
film->write_metadata ();
/* See if can make a DCP without any errors */
BOOST_CHECK (!JobManager::instance()->errors());
/* Compare the audio data player reads with what libsndfile reads */
BOOST_CHECK (!JobManager::instance()->errors());
/* Compare the audio data player reads with what libsndfile reads */
player->Audio.connect (bind (&audio, _1, info.channels));
while (!player->pass ()) {}
player->Audio.connect (bind (&audio, _1, info.channels));
while (!player->pass ()) {}
/* We don't want to test anything that requires resampling */
BOOST_REQUIRE_EQUAL (info.samplerate, 48000);
/* We don't want to test anything that requires resampling */
BOOST_REQUIRE_EQUAL (info.samplerate, 48000);
sf_count_t this_time = min (info.frames, sf_count_t(2000));
sf_readf_short (ref, buffer, this_time);
for (int j = 0; j < this_time; ++j) {
sf_count_t this_time = min (info.frames, sf_count_t(2000));
sf_readf_short (ref, buffer, this_time);
for (int j = 0; j < this_time; ++j) {
/* We don't want to test anything that requires resampling */
BOOST_REQUIRE_EQUAL (info.samplerate, 48000);
/* We don't want to test anything that requires resampling */
BOOST_REQUIRE_EQUAL (info.samplerate, 48000);
sf_count_t this_time = min (info.frames, sf_count_t(2000));
sf_readf_int (ref, buffer, this_time);
for (int j = 0; j < this_time; ++j) {
sf_count_t this_time = min (info.frames, sf_count_t(2000));
sf_readf_int (ref, buffer, this_time);
for (int j = 0; j < this_time; ++j) {
/* We don't want to test anything that requires resampling */
BOOST_REQUIRE_EQUAL (info.samplerate, 48000);
/* We don't want to test anything that requires resampling */
BOOST_REQUIRE_EQUAL (info.samplerate, 48000);
sf_count_t this_time = min (info.frames, sf_count_t(2000));
sf_readf_int (ref, buffer, this_time);
for (int j = 0; j < this_time; ++j) {
sf_count_t this_time = min (info.frames, sf_count_t(2000));
sf_readf_int (ref, buffer, this_time);
for (int j = 0; j < this_time; ++j) {