diff options
author | Robin Gareus <robin@gareus.org> | 2020-03-12 02:23:49 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-03-12 02:23:49 +0100 |
commit | 5b113c9c5b510abb3f619a7e82441f9f17379181 (patch) | |
tree | 1d18d8ff78fb82db859ff68da888c15b8e152f5a /libs/ardour/internal_send.cc | |
parent | 33f85b094b9df7c2e45a728a5c9b854479dc53c2 (diff) |
Fix un/bypassing Aux-send panners
This fixes issues with send-panner bypass whenever the
target bus input-count is different from the send's channel count.
--
Previously, when the aux-send panner was bypassed, data was
copied using BufferSet::read_from().
This sets the channel count of the output buffer set (here: mixbufs)
to match the input (here: bufs).
e.g. mono to stereo, "1 in -> 2 out" out was changed to "1 in -> 1 out".
Un-bypassing the panner later does not reconfigure the I/O.
Mixbufs remained mono, and PannerShell::run() "1 in -> 1 out"
does nothing. The panner was effectively not functional.
Diffstat (limited to 'libs/ardour/internal_send.cc')
-rw-r--r-- | libs/ardour/internal_send.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc index 2dd90d010f..6bc67a0059 100644 --- a/libs/ardour/internal_send.cc +++ b/libs/ardour/internal_send.cc @@ -226,7 +226,21 @@ InternalSend::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_sa } else { /* no panner or panner is bypassed */ assert (mixbufs.available () >= bufs.count ()); - mixbufs.read_from (bufs, nframes); + /* BufferSet::read_from() changes the channel-conut, + * so we manually copy bufs -> mixbufs + */ + for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) { + /* iterate over outputs */ + BufferSet::iterator i = bufs.begin (*t); + for (BufferSet::iterator o = mixbufs.begin (*t); o != mixbufs.end (*t); ++o) { + if (i == bufs.end (*t)) { + o->silence (nframes, 0); + } else { + o->read_from (*i, nframes); + ++i; + } + } + } } /* main gain control: * mute & bypass/enable */ |