summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sound_asset_writer.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sound_asset_writer.cc b/src/sound_asset_writer.cc
index 9ec93924..3ea2243b 100644
--- a/src/sound_asset_writer.cc
+++ b/src/sound_asset_writer.cc
@@ -211,6 +211,14 @@ LIBDCP_ENABLE_WARNINGS
std::sort(dcp_channels.begin(), dcp_channels.end());
dcp_channels.erase(std::unique(dcp_channels.begin(), dcp_channels.end()), dcp_channels.end());
+ /* Remove channels that aren't actually in this MXF at all */
+ dcp_channels.erase(
+ std::remove_if(dcp_channels.begin(), dcp_channels.end(), [this](dcp::Channel channel) {
+ return static_cast<int>(channel) >= _asset->channels();
+ }),
+ dcp_channels.end()
+ );
+
for (auto dcp_channel: dcp_channels) {
auto channel = new ASDCP::MXF::AudioChannelLabelSubDescriptor(asdcp_smpte_dict);
GenRandomValue (channel->MCALinkID);