Fix resizing aux input storage on buffer size
This nested `resize_with()` of course wouldn't resize the inner vectors of the outer ones were already the correct size.
This commit is contained in:
parent
4c9a2726f3
commit
b883a611ab
|
@ -1719,12 +1719,15 @@ impl<P: ClapPlugin> Wrapper<P> {
|
|||
// inputs. The slices will be assigned in the process function as this object may have
|
||||
// been moved before then.
|
||||
let mut aux_input_storage = wrapper.aux_input_storage.borrow_mut();
|
||||
aux_input_storage.resize_with(bus_config.aux_input_busses.num_busses as usize, || {
|
||||
vec![
|
||||
vec![0.0; max_frames_count as usize];
|
||||
bus_config.aux_input_busses.num_channels as usize
|
||||
]
|
||||
});
|
||||
aux_input_storage
|
||||
.resize_with(bus_config.aux_input_busses.num_busses as usize, Vec::new);
|
||||
for bus_storage in aux_input_storage.iter_mut() {
|
||||
bus_storage
|
||||
.resize_with(bus_config.aux_input_busses.num_channels as usize, Vec::new);
|
||||
for channel_storage in bus_storage {
|
||||
channel_storage.resize(max_frames_count as usize, 0.0);
|
||||
}
|
||||
}
|
||||
|
||||
let mut aux_input_buffers = wrapper.aux_input_buffers.borrow_mut();
|
||||
aux_input_buffers.resize_with(
|
||||
|
|
|
@ -413,15 +413,17 @@ impl<P: Vst3Plugin> IComponent for Wrapper<P> {
|
|||
// sidechain inputs. The slices will be assigned in the process function as this
|
||||
// object may have been moved before then.
|
||||
let mut aux_input_storage = self.inner.aux_input_storage.borrow_mut();
|
||||
aux_input_storage.resize_with(
|
||||
bus_config.aux_input_busses.num_busses as usize,
|
||||
|| {
|
||||
vec![
|
||||
vec![0.0; buffer_config.max_buffer_size as usize];
|
||||
bus_config.aux_input_busses.num_channels as usize
|
||||
]
|
||||
},
|
||||
aux_input_storage
|
||||
.resize_with(bus_config.aux_input_busses.num_busses as usize, Vec::new);
|
||||
for bus_storage in aux_input_storage.iter_mut() {
|
||||
bus_storage.resize_with(
|
||||
bus_config.aux_input_busses.num_channels as usize,
|
||||
Vec::new,
|
||||
);
|
||||
for channel_storage in bus_storage {
|
||||
channel_storage.resize(buffer_config.max_buffer_size as usize, 0.0);
|
||||
}
|
||||
}
|
||||
|
||||
let mut aux_input_buffers = self.inner.aux_input_buffers.borrow_mut();
|
||||
aux_input_buffers.resize_with(
|
||||
|
|
Loading…
Reference in a new issue