diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-03-16 23:03:08 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-03-29 17:43:07 +0200 |
| commit | bb1c1b89260cf36c621f7f2b471eb23f2ff15b0c (patch) | |
| tree | f344309fa1bd5cf065ff068ce91cdb0b2af11f5c /src | |
| parent | fbf2c165255989d189bd541fd9f6519c7249d1d7 (diff) | |
Always make 16-channel MXFs.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/reel_writer.cc | 13 | ||||
| -rw-r--r-- | src/lib/writer.cc | 4 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc index 31860e881..9ffe1cdc5 100644 --- a/src/lib/reel_writer.cc +++ b/src/lib/reel_writer.cc @@ -22,6 +22,7 @@ #include "audio_buffers.h" #include "compose.hpp" #include "config.h" +#include "constants.h" #include "cross.h" #include "dcpomatic_log.h" #include "digester.h" @@ -161,7 +162,7 @@ ReelWriter::ReelWriter ( } _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? */ @@ -177,7 +178,8 @@ ReelWriter::ReelWriter ( _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 ); @@ -195,8 +197,9 @@ ReelWriter::ReelWriter ( */ _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 ); } @@ -821,7 +824,7 @@ ReelWriter::write (shared_ptr<const AudioBuffers> audio) } DCPOMATIC_ASSERT (audio); - _sound_asset_writer->write (audio->data(), audio->frames()); + _sound_asset_writer->write(audio->data(), audio->channels(), audio->frames()); } diff --git a/src/lib/writer.cc b/src/lib/writer.cc index 2a2925cf0..b0bd4aaff 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -645,9 +645,7 @@ Writer::finish (boost::filesystem::path output_dcp) } 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; |
