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
@ -45,7 +45,7 @@ public:
|
||||
*/
|
||||
|
||||
static BufferSet& get_silent_buffers (ChanCount count = ChanCount::ZERO);
|
||||
static BufferSet& get_scratch_buffers (ChanCount count = ChanCount::ZERO);
|
||||
static BufferSet& get_scratch_buffers (ChanCount count = ChanCount::ZERO, bool silence = false);
|
||||
static BufferSet& get_route_buffers (ChanCount count = ChanCount::ZERO, bool silence = false);
|
||||
static BufferSet& get_mix_buffers (ChanCount count = ChanCount::ZERO);
|
||||
static gain_t* gain_automation_buffer ();
|
||||
|
@ -200,7 +200,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
|
||||
void process (pframes_t nframes);
|
||||
|
||||
BufferSet& get_silent_buffers (ChanCount count = ChanCount::ZERO);
|
||||
BufferSet& get_scratch_buffers (ChanCount count = ChanCount::ZERO);
|
||||
BufferSet& get_scratch_buffers (ChanCount count = ChanCount::ZERO, bool silence = true );
|
||||
BufferSet& get_route_buffers (ChanCount count = ChanCount::ZERO, bool silence = true);
|
||||
BufferSet& get_mix_buffers (ChanCount count = ChanCount::ZERO);
|
||||
|
||||
|
@ -448,7 +448,7 @@ PluginInsert::silence (framecnt_t nframes)
|
||||
}
|
||||
|
||||
for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
|
||||
(*i)->connect_and_run (_session.get_silent_buffers ((*i)->get_info()->n_inputs), in_map, out_map, nframes, 0);
|
||||
(*i)->connect_and_run (_session.get_scratch_buffers ((*i)->get_info()->n_inputs, true), in_map, out_map, nframes, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -4170,9 +4170,9 @@ Session::get_silent_buffers (ChanCount count)
|
||||
}
|
||||
|
||||
BufferSet&
|
||||
Session::get_scratch_buffers (ChanCount count)
|
||||
Session::get_scratch_buffers (ChanCount count, bool silence)
|
||||
{
|
||||
return ProcessThread::get_scratch_buffers (count);
|
||||
return ProcessThread::get_scratch_buffers (count, silence);
|
||||
}
|
||||
|
||||
BufferSet&
|
||||
|
Loading…
Reference in New Issue
Block a user