summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-03-21 01:11:01 +0100
committerCarl Hetherington <cth@carlh.net>2023-03-29 17:43:07 +0200
commitdf0e4e0278e66a27f8f3980e53d262332695f679 (patch)
tree7a7c968594b1b927ae4aa6476e4f42215cd36953 /src
parent72307b2d09d1e677909b67825e098e1765828c42 (diff)
Write the correct MCA subdescriptors depending on active channels.
Diffstat (limited to 'src')
-rw-r--r--src/lib/reel_writer.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc
index 9ffe1cdc5..8bd15a575 100644
--- a/src/lib/reel_writer.cc
+++ b/src/lib/reel_writer.cc
@@ -192,12 +192,25 @@ ReelWriter::ReelWriter (
DCPOMATIC_ASSERT (film()->directory());
+ auto mapped = film()->mapped_audio_channels();
+ std::vector<dcp::Channel> extra_active_channels;
+ auto add_if_mapped = [mapped, &extra_active_channels](dcp::Channel channel) {
+ if (std::find(mapped.begin(), mapped.end(), static_cast<int>(channel)) != mapped.end()) {
+ extra_active_channels.push_back(channel);
+ }
+ };
+
+ add_if_mapped(dcp::Channel::HI);
+ add_if_mapped(dcp::Channel::VI);
+ add_if_mapped(dcp::Channel::BSL);
+ add_if_mapped(dcp::Channel::BSR);
+
/* Write the sound asset into the film directory so that we leave the creation
of the DCP directory until the last minute.
*/
_sound_asset_writer = _sound_asset->start_write (
film()->directory().get() / audio_asset_filename (_sound_asset, _reel_index, _reel_count, _content_summary),
- film()->audio_channels(),
+ extra_active_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
);