mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-10 15:36:24 +01:00
use zeroed scratch buffers for "silent" plugin runs
Plugins rewrite the buffer data in-place and some plugins can produce output even when fed with silence. Hence, during a PluginInsert::silence() run a plugin can inject data into the "silent" buffers which causes side-effects. Kudos to Chris 'oofus' Goddard for finding this issue.
This commit is contained in:
parent
f81cbe06ea
commit
4dc74ae2ea
5 changed files with 14 additions and 6 deletions
|
|
@ -90,7 +90,7 @@ ProcessThread::get_silent_buffers (ChanCount count)
|
|||
}
|
||||
|
||||
BufferSet&
|
||||
ProcessThread::get_scratch_buffers (ChanCount count)
|
||||
ProcessThread::get_scratch_buffers (ChanCount count, bool silence)
|
||||
{
|
||||
ThreadBuffers* tb = _private_thread_buffers.get();
|
||||
assert (tb);
|
||||
|
|
@ -105,6 +105,14 @@ ProcessThread::get_scratch_buffers (ChanCount count)
|
|||
sb->set_count (sb->available());
|
||||
}
|
||||
|
||||
if (silence) {
|
||||
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
|
||||
for (uint32_t i = 0; i < sb->count().get(*t); ++i) {
|
||||
sb->get(*t, i).clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return *sb;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue