1
0
Fork 0

Always request flush when setting params from GUI

This commit is contained in:
Robbert van der Helm 2022-06-17 18:28:15 +02:00
parent 285f831e77
commit a291e0dfb6

View file

@ -645,11 +645,10 @@ impl<P: ClapPlugin> Wrapper<P> {
/// host (it will still be set on the plugin either way). /// host (it will still be set on the plugin either way).
pub fn queue_parameter_event(&self, event: OutputParamEvent) -> bool { pub fn queue_parameter_event(&self, event: OutputParamEvent) -> bool {
let result = self.output_parameter_events.push(event).is_ok(); let result = self.output_parameter_events.push(event).is_ok();
// Requesting a flush is fine even during audio processing. This avoids a race condition.
match &*self.host_params.borrow() { match &*self.host_params.borrow() {
Some(host_params) if !self.is_processing.load(Ordering::SeqCst) => { Some(host_params) => unsafe { (host_params.request_flush)(&*self.host_callback) },
unsafe { (host_params.request_flush)(&*self.host_callback) };
}
Some(_) => (),
None => nih_debug_assert_failure!("The host does not support parameters? What?"), None => nih_debug_assert_failure!("The host does not support parameters? What?"),
} }