VST3: Re-activate plugin when latency changes

This is required. From the "RestartFlags" documentation:

> kLatencyChanged:
>   Latency has changed The plug informs the host that its latency
>   has changed, getLatencySamples should return the new latency after
>   setActive (true) was called The host has to deactivate and reactivate
>   the plug-in, then afterwards the host could ask for the current
>   latency (getLatencySamples) see IAudioProcessor::getLatencySamples
This commit is contained in:
Robin Gareus 2020-09-18 19:39:50 +02:00
parent 3ed9a712b9
commit 57c660836f
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -1247,6 +1247,9 @@ VST3PI::restartComponent (int32 flags)
update_shadow_data ();
}
if (flags & Vst::kLatencyChanged) {
/* need to re-activate the plugin as per spec */
deactivate ();
activate ();
_plugin_latency.reset ();
}
return kResultOk;