summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-10-16 23:12:33 +0200
committerCarl Hetherington <cth@carlh.net>2023-10-16 23:12:33 +0200
commitb7c82dec9d396a46ef3291eeaa956cb385081d81 (patch)
tree283afbb2c10a486d3873bc7afe001734484b6d62 /src
parent0f468748557a3c99c708b2fccafc541776125524 (diff)
Cleanup: add some comments.
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 a7be0859..49170990 100644
--- a/src/sound_asset_writer.cc
+++ b/src/sound_asset_writer.cc
@@ -190,6 +190,9 @@ LIBDCP_ENABLE_WARNINGS
_state->mxf_writer.OP1aHeader().AddChildObject(soundfield);
essence_descriptor->SubDescriptors.push_back(soundfield->InstanceUID);
+ /* We always make a descriptor for these channels if they are present in the asset;
+ * there's no way for the caller to tell us whether they are active or not.
+ */
std::vector<dcp::Channel> dcp_channels = {
Channel::LEFT,
Channel::RIGHT,
@@ -199,7 +202,12 @@ LIBDCP_ENABLE_WARNINGS
Channel::RS
};
+ /* We add descriptors for some extra channels that the caller gave us (we made sure earlier
+ * that nothing "bad" is in this list).
+ */
std::copy(_extra_active_channels.begin(), _extra_active_channels.end(), back_inserter(dcp_channels));
+
+ /* Remove duplicates */
std::sort(dcp_channels.begin(), dcp_channels.end());
auto last = std::unique(dcp_channels.begin(), dcp_channels.end());
dcp_channels.erase(last, dcp_channels.end());