1
0
Fork 0

Also move reset() call to process start for CLAP

So the behavior is consistent for CLAP and VST3.
This commit is contained in:
Robbert van der Helm 2022-04-26 14:14:12 +02:00
parent 4ac0c40812
commit 4779991edf

View file

@ -1478,8 +1478,8 @@ impl<P: ClapPlugin> Wrapper<P> {
&buffer_config,
&mut wrapper.make_process_context(Transport::new(buffer_config.sample_rate)),
) {
// As per-the trait docs we'll always call this after the initialization function
process_wrapper(|| plugin.reset());
// NOTE: `Plugin::reset()` is called in `clap_plugin::start_processing()` instead of in
// this function
// Preallocate enough room in the output slices vector so we can convert a `*mut *mut
// f32` to a `&mut [&mut f32]` in the process call
@ -1513,6 +1513,10 @@ impl<P: ClapPlugin> Wrapper<P> {
wrapper.last_process_status.store(ProcessStatus::Normal);
wrapper.is_processing.store(true, Ordering::SeqCst);
// To be consistent with the VST3 wrapper, we'll also reset the buffers here in addition to
// the dedicated `reset()` function.
process_wrapper(|| wrapper.plugin.write().reset());
true
}