# Use distro-provided FFmpeg on Arch
deps = []
- deps.append(('libdcp', 'v1.8.64'))
+ deps.append(('libdcp', 'v1.8.65'))
deps.append(('libsub', 'v1.6.44'))
deps.append(('leqm-nrt', '4560105773c66ac9216b62313a24093bb0a027ae'))
deps.append(('rtaudio', 'f619b76'))
# e.g. --run_tests=foo
set -e
-PRIVATE_GIT="fe0425b204ed2dcac9e6e134b72fba7f43d8c2eb"
+PRIVATE_GIT="49276da301a937fbf09bc9e7b5a537cdee72bc46"
if [ "$1" == "--check" ]; then
shift 1
#include "audio_buffers.h"
#include "compose.hpp"
#include "config.h"
+#include "constants.h"
#include "cross.h"
#include "dcpomatic_log.h"
#include "digester.h"
}
_picture_asset->set_file (asset);
- _picture_asset_writer = _picture_asset->start_write (asset, _first_nonexistent_frame > 0);
+ _picture_asset_writer = _picture_asset->start_write(asset, _first_nonexistent_frame > 0 ? dcp::PictureAsset::Behaviour::OVERWRITE_EXISTING : dcp::PictureAsset::Behaviour::MAKE_NEW);
} else if (!text_only) {
/* We already have a complete picture asset that we can just re-use */
/* XXX: what about if the encryption key changes? */
_sound_asset = make_shared<dcp::SoundAsset> (
dcp::Fraction(film()->video_frame_rate(), 1),
film()->audio_frame_rate(),
- film()->audio_channels(),
+ /* Always make 16-channel sound assets for SMPTE; libdcp will pad unused channels for us */
+ standard == dcp::Standard::SMPTE ? MAX_DCP_AUDIO_CHANNELS : film()->audio_channels(),
lang ? *lang : dcp::LanguageTag("en-US"),
standard
);
*/
_sound_asset_writer = _sound_asset->start_write (
film()->directory().get() / audio_asset_filename (_sound_asset, _reel_index, _reel_count, _content_summary),
- film()->contains_atmos_content(),
- !film()->limit_to_smpte_bv20()
+ film()->audio_channels(),
+ film()->contains_atmos_content() ? dcp::SoundAsset::AtmosSync::ENABLED : dcp::SoundAsset::AtmosSync::DISABLED,
+ film()->limit_to_smpte_bv20() ? dcp::SoundAsset::MCASubDescriptors::DISABLED : dcp::SoundAsset::MCASubDescriptors::ENABLED
);
}
}
DCPOMATIC_ASSERT (audio);
- _sound_asset_writer->write (audio->data(), audio->frames());
+ _sound_asset_writer->write(audio->data(), audio->channels(), audio->frames());
}
}
dcp::MCASoundField field;
- if (film()->audio_channels() == 2) {
- field = dcp::MCASoundField::STEREO;
- } else if (film()->audio_channels() <= 6) {
+ if (film()->audio_channels() <= 6) {
field = dcp::MCASoundField::FIVE_POINT_ONE;
} else {
field = dcp::MCASoundField::SEVEN_POINT_ONE;
-Subproject commit c79ab114fdd6ca5f2f20a9d13d9203826f7f6c6a
+Subproject commit e9a0aaeeafed9ba73d09e0ee97f6fe2f6ba1b9d6
*/
-#include "lib/ffmpeg_content.h"
-#include "lib/film.h"
+#include "lib/constants.h"
+#include "lib/content_factory.h"
#include "lib/dcp_content_type.h"
-#include "lib/video_content.h"
-#include "lib/ratio.h"
#include "lib/ffmpeg_content.h"
-#include "lib/content_factory.h"
+#include "lib/ffmpeg_content.h"
+#include "lib/film.h"
#include "lib/player.h"
+#include "lib/ratio.h"
+#include "lib/video_content.h"
#include "test.h"
#include <dcp/cpl.h>
#include <dcp/dcp.h>
auto sound_asset = check.cpls().front()->reels().front()->main_sound ();
BOOST_CHECK (sound_asset);
- BOOST_CHECK_EQUAL (sound_asset->asset()->channels (), 6);
+ BOOST_CHECK_EQUAL(sound_asset->asset()->channels (), 16);
/* Sample index in the DCP */
int n = 0;
while (n < sound_asset->asset()->intrinsic_duration()) {
auto sound_frame = sound_asset->asset()->start_read()->get_frame (frame++);
uint8_t const * d = sound_frame->data ();
-
- for (int i = 0; i < sound_frame->size(); i += (3 * sound_asset->asset()->channels())) {
-
- if (sound_asset->asset()->channels() > 0) {
- /* L should be silent */
- int const sample = d[i + 0] | (d[i + 1] << 8);
- BOOST_CHECK_EQUAL (sample, 0);
+ for (int offset = 0; offset < sound_frame->size(); offset += (3 * sound_asset->asset()->channels())) {
+ for (auto channel = 0; channel < MAX_DCP_AUDIO_CHANNELS; ++channel) {
+ auto const sample = d[offset + channel * 3 + 1] | (d[offset + channel * 3 + 2] << 8);
+ if (channel == 2) {
+ /* Input should be on centre */
+ BOOST_CHECK_EQUAL(sample, n);
+ } else {
+ /* Everything else should be silent */
+ BOOST_CHECK_EQUAL(sample, 0);
+ }
}
-
- if (sound_asset->asset()->channels() > 1) {
- /* R should be silent */
- int const sample = d[i + 2] | (d[i + 3] << 8);
- BOOST_CHECK_EQUAL (sample, 0);
- }
-
- if (sound_asset->asset()->channels() > 2) {
- /* Mono input so it will appear on centre */
- int const sample = d[i + 7] | (d[i + 8] << 8);
- BOOST_CHECK_EQUAL (sample, n);
- }
-
- if (sound_asset->asset()->channels() > 3) {
- /* Lfe should be silent */
- int const sample = d[i + 9] | (d[i + 10] << 8);
- BOOST_CHECK_EQUAL (sample, 0);
- }
-
- if (sound_asset->asset()->channels() > 4) {
- /* Ls should be silent */
- int const sample = d[i + 11] | (d[i + 12] << 8);
- BOOST_CHECK_EQUAL (sample, 0);
- }
-
-
- if (sound_asset->asset()->channels() > 5) {
- /* Rs should be silent */
- int const sample = d[i + 13] | (d[i + 14] << 8);
- BOOST_CHECK_EQUAL (sample, 0);
- }
-
++n;
}
}
static void
-test_silence_padding (int channels)
+test_silence_padding(int channels, dcp::Standard standard)
{
string const film_name = "silence_padding_test_" + lexical_cast<string> (channels);
auto film = new_test_film2 (
make_shared<FFmpegContent>("test/data/staircase.wav")
});
+ if (standard == dcp::Standard::INTEROP) {
+ film->set_interop(true);
+ }
film->set_audio_channels (channels);
- make_and_verify_dcp (film);
+
+ std::vector<dcp::VerificationNote::Code> codes;
+ if (standard == dcp::Standard::INTEROP) {
+ codes.push_back(dcp::VerificationNote::Code::INVALID_STANDARD);
+ }
+ make_and_verify_dcp(film, codes);
boost::filesystem::path path = "build/test";
path /= film_name;
/* DCP sound asset frame */
int frame = 0;
+ auto const asset_channels = sound_asset->asset()->channels();
+ if (standard == dcp::Standard::SMPTE) {
+ DCP_ASSERT(asset_channels == MAX_DCP_AUDIO_CHANNELS)
+ } else {
+ DCP_ASSERT(asset_channels == channels);
+ }
+
while (n < sound_asset->asset()->intrinsic_duration()) {
auto sound_frame = sound_asset->asset()->start_read()->get_frame(frame++);
uint8_t const * d = sound_frame->data ();
BOOST_AUTO_TEST_CASE (silence_padding_test)
{
for (int i = 1; i < MAX_DCP_AUDIO_CHANNELS; ++i) {
- test_silence_padding (i);
+ test_silence_padding(i, dcp::Standard::INTEROP);
}
+
+ test_silence_padding(MAX_DCP_AUDIO_CHANNELS, dcp::Standard::SMPTE);
}