From 4e244c8a4b34268445123b7d6df54ff303561fa5 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 6 Jul 2025 23:23:26 +0200 Subject: Allow audio processors to pass through HI/VI/DBox etc (#3020). Previously you couldn't map these things if you were using a processor. --- src/lib/mid_side_decoder.cc | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/lib/mid_side_decoder.cc') diff --git a/src/lib/mid_side_decoder.cc b/src/lib/mid_side_decoder.cc index 695e4cad7..719dbce92 100644 --- a/src/lib/mid_side_decoder.cc +++ b/src/lib/mid_side_decoder.cc @@ -62,7 +62,7 @@ MidSideDecoder::clone(int) const shared_ptr -MidSideDecoder::run(shared_ptr in, int channels) +MidSideDecoder::do_run(shared_ptr in, int channels) { int const N = min(channels, 3); auto out = make_shared(channels, in->frames()); @@ -88,9 +88,12 @@ MidSideDecoder::run(shared_ptr in, int channels) void MidSideDecoder::make_audio_mapping_default(AudioMapping& mapping) const { - /* Just map the first two input channels to our M/S */ - mapping.make_zero(); - for (int i = 0; i < min(2, mapping.input_channels()); ++i) { + AudioProcessor::make_audio_mapping_default(mapping); + + auto const inputs = mapping.input_channels(); + + /* Map the first two input channels to our M/S */ + for (int i = 0; i < min(2, inputs); ++i) { mapping.set(i, i, 1); } } @@ -99,8 +102,14 @@ MidSideDecoder::make_audio_mapping_default(AudioMapping& mapping) const vector MidSideDecoder::input_names() const { - return { + vector names = { NamedChannel(_("Left"), 0), NamedChannel(_("Right"), 1) }; + + for (auto name: AudioProcessor::input_names()) { + names.push_back(name); + } + + return names; } -- cgit v1.2.3