diff options
author | Robin Gareus <robin@gareus.org> | 2020-02-06 21:40:02 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-02-06 21:40:02 +0100 |
commit | 5fb38c7c53a0f6e20c44f05623a9e5f049903799 (patch) | |
tree | 33dff9893a890289b3de861276b70c461ff43db0 /libs/ardour/dsp_filter.cc | |
parent | f2980e5f05467f94b514531fc39ebda7d544cf6f (diff) |
Fix DSP::process_map edge-case (unconnected inputs)
previously this could result in signals being passed though
(in-place) when inputs were disconnected.
Diffstat (limited to 'libs/ardour/dsp_filter.cc')
-rw-r--r-- | libs/ardour/dsp_filter.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/ardour/dsp_filter.cc b/libs/ardour/dsp_filter.cc index 1462fba431..6ffcc7ee21 100644 --- a/libs/ardour/dsp_filter.cc +++ b/libs/ardour/dsp_filter.cc @@ -78,6 +78,7 @@ void ARDOUR::DSP::process_map (BufferSet* bufs, const ChanMapping& in, const ChanMapping& out, pframes_t nframes, samplecnt_t offset, const DataType& dt) { const ChanMapping::Mappings& im (in.mappings()); + const ChanMapping::Mappings& om (out.mappings()); for (ChanMapping::Mappings::const_iterator tm = im.begin(); tm != im.end(); ++tm) { if (tm->first != dt) { continue; } @@ -100,6 +101,17 @@ ARDOUR::DSP::process_map (BufferSet* bufs, const ChanMapping& in, const ChanMapp } } + /* reverse lookup (in case input map is empty */ + for (ChanMapping::Mappings::const_iterator tm = om.begin(); tm != om.end(); ++tm) { + if (tm->first != dt) { continue; } + for (ChanMapping::TypeMapping::const_iterator i = tm->second.begin(); i != tm->second.end(); ++i) { + bool valid; + in.get_src (dt, i->first, &valid); + if (!valid) { + bufs->get_available (dt, i->second).silence (nframes, offset); + } + } + } } LowPass::LowPass (double samplerate, float freq) |