From 6142c814bf991b829ccb8818050d0cac8ffb9d9e Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 6 May 2014 23:34:04 +0200 Subject: [PATCH] provide plugins with all available buffers. e.g. Audio in -> Midi out plugins (on an audio-track). Midi-buffers do exist in the route but no corresponding (physical) Input port-buffer exists and ardour crashed. Now, the plugin itself still only accesses the mapped ports (ChanMapping), but the mapped buffers are at most "processor_max_streams" and at least the required in+out buffers for the plugin. --- libs/ardour/plugin_insert.cc | 3 +++ libs/ardour/port_set.cc | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index 13ac7b375a..6fbb5cb679 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -352,6 +352,9 @@ PluginInsert::connect_and_run (BufferSet& bufs, pframes_t nframes, framecnt_t of } } + bufs.set_count(ChanCount::max(bufs.count(), in_streams)); + bufs.set_count(ChanCount::max(bufs.count(), out_streams)); + /* Note that we've already required that plugins be able to handle in-place processing. */ diff --git a/libs/ardour/port_set.cc b/libs/ardour/port_set.cc index c7f5e2e674..3489ae4e44 100644 --- a/libs/ardour/port_set.cc +++ b/libs/ardour/port_set.cc @@ -145,9 +145,11 @@ PortSet::port(DataType type, size_t n) const return port(n); } else { const PortVec& v = _ports[type]; - assert(n < v.size()); - return v[n]; + if (n < v.size()) { + return v[n]; + } } + return boost::shared_ptr(); } boost::shared_ptr -- 2.30.2