summaryrefslogtreecommitdiff
path: root/libs/ardour/route.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-02-20 01:48:22 +0100
committerRobin Gareus <robin@gareus.org>2020-02-20 01:57:14 +0100
commit89bd6cafa01f5062adcace2913f926d147d05720 (patch)
tree2dc90579d2efc13e8b4d78fa4aa85fe16aa20b07 /libs/ardour/route.cc
parentc8f114612446b612ebe9f53da65b33e4f6adef0f (diff)
Force Disk-Reader channel count to match Disk-Writer I/O.
This handles some special cases where a plugin is added after the disk-writer but before the disk-reader. The plugin may add/remove ports (e.g. an instrument: MIDI to audio, or some stereo to mono processors). However we need to ensure that any data that is recorded will be played back. This is a new take replacing b2bc934e2.
Diffstat (limited to 'libs/ardour/route.cc')
-rw-r--r--libs/ardour/route.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index 245c598a07..a2e1a4fbf0 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -464,6 +464,11 @@ Route::process_output_buffers (BufferSet& bufs,
bool re_inject_oob_data = false;
if ((*i) == _disk_reader) {
+ /* ignore port-count from prior plugins, use DR's count.
+ * see also Route::try_configure_processors_unlocked
+ */
+ bufs.set_count ((*i)->output_streams());
+
/* Well now, we've made it past the disk-writer and to the disk-reader.
* Time to decide what to do about monitoring.
*
@@ -1751,8 +1756,15 @@ Route::try_configure_processors_unlocked (ChanCount in, ProcessorStreams* err)
DEBUG_TRACE (DEBUG::Processors, string_compose ("%1: configure processors\n", _name));
DEBUG_TRACE (DEBUG::Processors, "{\n");
+ ChanCount disk_io = in;
+
for (ProcessorList::iterator p = _processors.begin(); p != _processors.end(); ++p, ++index) {
+ if (boost::dynamic_pointer_cast<DiskReader> (*p)) {
+ /* disk-reader has the same i/o as disk-writer */
+ in = max (in, disk_io);
+ }
+
if ((*p)->can_support_io_configuration(in, out)) {
if (boost::dynamic_pointer_cast<Delivery> (*p)
@@ -1822,6 +1834,14 @@ Route::try_configure_processors_unlocked (ChanCount in, ProcessorStreams* err)
return list<pair<ChanCount, ChanCount> > ();
}
}
+
+ if (boost::dynamic_pointer_cast<DiskWriter> (*p)) {
+ assert (in == out);
+ disk_io = out;
+ }
+
+
+ /* next processor's in == this processor's out*/
in = out;
} else {
if (err) {