summaryrefslogtreecommitdiff
path: root/src/lib/film.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-07-06 23:23:26 +0200
committercah <cth@carlh.net>2025-07-10 22:49:00 +0200
commit4e244c8a4b34268445123b7d6df54ff303561fa5 (patch)
tree54b92d242ea518ee0e9d55c20265d5ab963fc7a0 /src/lib/film.cc
parenta564301f86068484d98d329971f59b10c7de892e (diff)
Allow audio processors to pass through HI/VI/DBox etc (#3020).
Previously you couldn't map these things if you were using a processor.
Diffstat (limited to 'src/lib/film.cc')
-rw-r--r--src/lib/film.cc23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc
index 58699743b..b73c2bac6 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -791,10 +791,23 @@ Film::mapped_audio_channels() const
list<int> mapped;
if (audio_processor()) {
- /* Processors are mapped 1:1 to DCP outputs so we can work out mappings from there */
+ /* Assume all a processor's declared output channels are mapped */
for (int i = 0; i < audio_processor()->out_channels(); ++i) {
mapped.push_back(i);
}
+
+ /* Check to see if channels that the processor passes through are mapped */
+ auto pass = AudioProcessor::pass_through();
+ for (auto i: content()) {
+ if (i->audio) {
+ for (auto c: i->audio->mapping().mapped_output_channels()) {
+ if (std::find(pass.begin(), pass.end(), dcp::Channel(c)) != pass.end()) {
+ mapped.push_back(c);
+ }
+ }
+ }
+ }
+
} else {
for (auto i: content()) {
if (i->audio) {
@@ -1885,7 +1898,13 @@ vector<NamedChannel>
Film::audio_output_channel_names() const
{
if (audio_processor()) {
- return audio_processor()->input_names();
+ vector<NamedChannel> channels;
+ for (auto input: audio_processor()->input_names()) {
+ if (input.index < audio_channels()) {
+ channels.push_back(input);
+ }
+ }
+ return channels;
}
DCPOMATIC_ASSERT(MAX_DCP_AUDIO_CHANNELS == 16);