diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-10-16 23:13:10 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-10-17 12:44:04 +0200 |
| commit | 06c02f781597a5679c9a2fcdc7a7c9f79f58f6f4 (patch) | |
| tree | c8ce7dff80911b4513c4d5ff109689aecd03c638 /src | |
| parent | 460e2fb65c378256a8f8fb7f3249f746c5b1990e (diff) | |
Don't write MCA subdescriptors for channels that don't exist in the MXF (#2631).v1.8.86
This causes some test ID churn.
Diffstat (limited to 'src')
| -rw-r--r-- | src/sound_asset_writer.cc | 8 |
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); |
