}
}
+ ChanCount required_buffers () const { return _required_buffers; }
+
// allow to override output_streams(), implies "Custom Mode"
// only the owning route may call these (with process lock held)
ChanCount _configured_out;
ChanCount _custom_out;
ChanCount _cached_sidechain_pins;
+ ChanCount _required_buffers;
bool _configured;
bool _no_inplace;
_no_inplace = check_inplace ();
_mapping_changed = false;
+ /* only the "noinplace_buffers" thread buffers need to be this large,
+ * this can be optimized. other buffers are fine with
+ * ChanCount::max (natural_input_streams (), natural_output_streams())
+ */
+ _required_buffers = natural_input_streams () + natural_output_streams() * get_count();
+
if (old_in != in || old_out != out || old_internal != _configured_internal
|| (old_match.method != _match.method && (old_match.method == Split || _match.method == Split))
) {
processor_max_streams = ChanCount::max(processor_max_streams, c->first);
processor_max_streams = ChanCount::max(processor_max_streams, c->second);
+ boost::shared_ptr<IOProcessor> iop;
boost::shared_ptr<PluginInsert> pi;
if ((pi = boost::dynamic_pointer_cast<PluginInsert>(*p)) != 0) {
/* plugins connected via Split or Hide Match may have more channels.
* route/scratch buffers are needed for all of them
* The configuration may only be a subset (both input and output)
*/
- processor_max_streams = ChanCount::max(processor_max_streams, pi->input_streams());
- processor_max_streams = ChanCount::max(processor_max_streams, pi->internal_streams());
- processor_max_streams = ChanCount::max(processor_max_streams, pi->output_streams());
- processor_max_streams = ChanCount::max(processor_max_streams, pi->natural_input_streams() * pi->get_count());
- processor_max_streams = ChanCount::max(processor_max_streams, pi->natural_output_streams() * pi->get_count());
+ processor_max_streams = ChanCount::max(processor_max_streams, pi->required_buffers());
+ }
+ else if ((iop = boost::dynamic_pointer_cast<IOProcessor>(*p)) != 0) {
+ processor_max_streams = ChanCount::max(processor_max_streams, iop->natural_input_streams());
+ processor_max_streams = ChanCount::max(processor_max_streams, iop->natural_output_streams());
}
out = c->second;
}
scratch_buffers->ensure_buffers (*t, count, size);
- noinplace_buffers->ensure_buffers (*t, count + count, size); // in + out
+ noinplace_buffers->ensure_buffers (*t, count, size);
mix_buffers->ensure_buffers (*t, count, size);
silent_buffers->ensure_buffers (*t, count, size);
route_buffers->ensure_buffers (*t, count, size);