X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Freel_writer.cc;h=8bd15a575581a5126a62b856b4b5595bd6eda958;hp=9ffe1cdc53f1a2f9f45344cd86bbbaa778cbcd30;hb=df0e4e0278e66a27f8f3980e53d262332695f679;hpb=72307b2d09d1e677909b67825e098e1765828c42 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 extra_active_channels; + auto add_if_mapped = [mapped, &extra_active_channels](dcp::Channel channel) { + if (std::find(mapped.begin(), mapped.end(), static_cast(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 );