Cleanup: add some comments.
authorCarl Hetherington <cth@carlh.net>
Mon, 16 Oct 2023 21:12:33 +0000 (23:12 +0200)
committerCarl Hetherington <cth@carlh.net>
Mon, 16 Oct 2023 21:12:33 +0000 (23:12 +0200)
src/sound_asset_writer.cc

index a7be0859251c4fb74d7be4562cd985aad4a484a2..491709909daad9401cca55c33e0f0e893ea0d00e 100644 (file)
@@ -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());