From 9eaf375f6be196d2574d20607741e55a29fbfdc7 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sun, 26 Feb 2023 01:17:44 +0100 Subject: [PATCH] Relax VST3 aux input debug assertions for flushes --- src/wrapper/vst3/wrapper.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/wrapper/vst3/wrapper.rs b/src/wrapper/vst3/wrapper.rs index 2ebe39f6..cecae56e 100644 --- a/src/wrapper/vst3/wrapper.rs +++ b/src/wrapper/vst3/wrapper.rs @@ -1381,14 +1381,18 @@ impl IAudioProcessor for Wrapper

{ || storage.is_empty() || (*host_input).num_channels != buffer.channels() as i32 { - nih_debug_assert!(host_input_idx < data.num_inputs as usize); - nih_debug_assert!(!data.inputs.is_null()); + // During a parameter flush the number of inputs/outputs may be 0 and the + // number of channels may be 0, so these assertions need to be a bit more + // relaxed + nih_debug_assert!( + data.num_inputs == 0 || host_input_idx < data.num_inputs as usize + ); nih_debug_assert!(!storage.is_empty()); if !data.inputs.is_null() && host_input_idx < data.num_inputs as usize { nih_debug_assert!(!(*host_input).buffers.is_null()); - nih_debug_assert_eq!( - (*host_input).num_channels, - buffer.channels() as i32 + nih_debug_assert!( + (*host_input).num_channels == 0 + || (*host_input).num_channels == buffer.channels() as i32 ); }