Request restart for latency change when processing
Calling this change function seems to work fine, but apparently you're supposed to do it this way.
This commit is contained in:
parent
6c9db8fee8
commit
542012aa0e
1 changed files with 11 additions and 1 deletions
|
@ -265,7 +265,17 @@ impl<P: ClapPlugin> MainThreadExecutor<Task> for Wrapper<P> {
|
||||||
// This function is always called from the main thread, from [Self::on_main_thread].
|
// This function is always called from the main thread, from [Self::on_main_thread].
|
||||||
match task {
|
match task {
|
||||||
Task::LatencyChanged => match &*self.host_latency.borrow() {
|
Task::LatencyChanged => match &*self.host_latency.borrow() {
|
||||||
Some(host_latency) => (host_latency.changed)(&*self.host_callback),
|
Some(host_latency) => {
|
||||||
|
// XXX: The CLAP docs mention that you should request a restart if this happens
|
||||||
|
// while the plugin is activated (which is not entirely the same thing as
|
||||||
|
// is processing, but we'll treat it as the same thing). In practice just
|
||||||
|
// calling the latency changed function also seems to work just fine.
|
||||||
|
if self.is_processing.load(Ordering::SeqCst) {
|
||||||
|
(self.host_callback.request_restart)(&*self.host_callback)
|
||||||
|
} else {
|
||||||
|
(host_latency.changed)(&*self.host_callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
None => nih_debug_assert_failure!("Host does not support the latency extension"),
|
None => nih_debug_assert_failure!("Host does not support the latency extension"),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue