mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 08:36:32 +01:00
properly calculate requrired thread buffers
This commit is contained in:
parent
5af4ce47eb
commit
7962176219
4 changed files with 16 additions and 6 deletions
|
|
@ -134,6 +134,8 @@ class LIBARDOUR_API PluginInsert : public Processor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ChanCount required_buffers () const { return _required_buffers; }
|
||||||
|
|
||||||
// allow to override output_streams(), implies "Custom Mode"
|
// allow to override output_streams(), implies "Custom Mode"
|
||||||
|
|
||||||
// only the owning route may call these (with process lock held)
|
// only the owning route may call these (with process lock held)
|
||||||
|
|
@ -305,6 +307,7 @@ class LIBARDOUR_API PluginInsert : public Processor
|
||||||
ChanCount _configured_out;
|
ChanCount _configured_out;
|
||||||
ChanCount _custom_out;
|
ChanCount _custom_out;
|
||||||
ChanCount _cached_sidechain_pins;
|
ChanCount _cached_sidechain_pins;
|
||||||
|
ChanCount _required_buffers;
|
||||||
|
|
||||||
bool _configured;
|
bool _configured;
|
||||||
bool _no_inplace;
|
bool _no_inplace;
|
||||||
|
|
|
||||||
|
|
@ -1455,6 +1455,12 @@ PluginInsert::configure_io (ChanCount in, ChanCount out)
|
||||||
_no_inplace = check_inplace ();
|
_no_inplace = check_inplace ();
|
||||||
_mapping_changed = false;
|
_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
|
if (old_in != in || old_out != out || old_internal != _configured_internal
|
||||||
|| (old_match.method != _match.method && (old_match.method == Split || _match.method == Split))
|
|| (old_match.method != _match.method && (old_match.method == Split || _match.method == Split))
|
||||||
) {
|
) {
|
||||||
|
|
|
||||||
|
|
@ -2199,17 +2199,18 @@ Route::configure_processors_unlocked (ProcessorStreams* err)
|
||||||
processor_max_streams = ChanCount::max(processor_max_streams, c->first);
|
processor_max_streams = ChanCount::max(processor_max_streams, c->first);
|
||||||
processor_max_streams = ChanCount::max(processor_max_streams, c->second);
|
processor_max_streams = ChanCount::max(processor_max_streams, c->second);
|
||||||
|
|
||||||
|
boost::shared_ptr<IOProcessor> iop;
|
||||||
boost::shared_ptr<PluginInsert> pi;
|
boost::shared_ptr<PluginInsert> pi;
|
||||||
if ((pi = boost::dynamic_pointer_cast<PluginInsert>(*p)) != 0) {
|
if ((pi = boost::dynamic_pointer_cast<PluginInsert>(*p)) != 0) {
|
||||||
/* plugins connected via Split or Hide Match may have more channels.
|
/* plugins connected via Split or Hide Match may have more channels.
|
||||||
* route/scratch buffers are needed for all of them
|
* route/scratch buffers are needed for all of them
|
||||||
* The configuration may only be a subset (both input and output)
|
* 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->required_buffers());
|
||||||
processor_max_streams = ChanCount::max(processor_max_streams, pi->internal_streams());
|
}
|
||||||
processor_max_streams = ChanCount::max(processor_max_streams, pi->output_streams());
|
else if ((iop = boost::dynamic_pointer_cast<IOProcessor>(*p)) != 0) {
|
||||||
processor_max_streams = ChanCount::max(processor_max_streams, pi->natural_input_streams() * pi->get_count());
|
processor_max_streams = ChanCount::max(processor_max_streams, iop->natural_input_streams());
|
||||||
processor_max_streams = ChanCount::max(processor_max_streams, pi->natural_output_streams() * pi->get_count());
|
processor_max_streams = ChanCount::max(processor_max_streams, iop->natural_output_streams());
|
||||||
}
|
}
|
||||||
out = c->second;
|
out = c->second;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ ThreadBuffers::ensure_buffers (ChanCount howmany, size_t custom)
|
||||||
}
|
}
|
||||||
|
|
||||||
scratch_buffers->ensure_buffers (*t, count, size);
|
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);
|
mix_buffers->ensure_buffers (*t, count, size);
|
||||||
silent_buffers->ensure_buffers (*t, count, size);
|
silent_buffers->ensure_buffers (*t, count, size);
|
||||||
route_buffers->ensure_buffers (*t, count, size);
|
route_buffers->ensure_buffers (*t, count, size);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue