1
0
Fork 0

Relax VST3 aux input debug assertions for flushes

This commit is contained in:
Robbert van der Helm 2023-02-26 01:17:44 +01:00
parent 767cff6294
commit 9eaf375f6b

View file

@ -1381,14 +1381,18 @@ impl<P: Vst3Plugin> IAudioProcessor for Wrapper<P> {
|| storage.is_empty() || storage.is_empty()
|| (*host_input).num_channels != buffer.channels() as i32 || (*host_input).num_channels != buffer.channels() as i32
{ {
nih_debug_assert!(host_input_idx < data.num_inputs as usize); // During a parameter flush the number of inputs/outputs may be 0 and the
nih_debug_assert!(!data.inputs.is_null()); // 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()); nih_debug_assert!(!storage.is_empty());
if !data.inputs.is_null() && host_input_idx < data.num_inputs as usize { if !data.inputs.is_null() && host_input_idx < data.num_inputs as usize {
nih_debug_assert!(!(*host_input).buffers.is_null()); nih_debug_assert!(!(*host_input).buffers.is_null());
nih_debug_assert_eq!( nih_debug_assert!(
(*host_input).num_channels, (*host_input).num_channels == 0
buffer.channels() as i32 || (*host_input).num_channels == buffer.channels() as i32
); );
} }