mirror of
https://github.com/robbert-vdh/nih-plug.git
synced 2026-07-01 02:36:54 +00:00
Fix alloc failures in VST3 with many events
Or well, work around. We should use a different non-allocating sorting implementation here. This only crept up in Ardour because they for some reason send all parameter values after loading a VST3 plugin.
This commit is contained in:
@@ -1251,9 +1251,13 @@ impl<P: Vst3Plugin> IAudioProcessor for Wrapper<P> {
|
||||
// processed before note events. Otherwise you'll get out of bounds note events
|
||||
// with block splitting when the note event occurs at one index after the end (or
|
||||
// on the exclusive end index) of the block.
|
||||
process_events.sort_by_key(|event| match event {
|
||||
ProcessEvent::ParameterChange { timing, .. } => *timing,
|
||||
ProcessEvent::NoteEvent { timing, .. } => *timing,
|
||||
// FIXME: Apparently stable sort allcoates if the slice is large enough. This should be
|
||||
// fixed at some point.
|
||||
permit_alloc(|| {
|
||||
process_events.sort_by_key(|event| match event {
|
||||
ProcessEvent::ParameterChange { timing, .. } => *timing,
|
||||
ProcessEvent::NoteEvent { timing, .. } => *timing,
|
||||
})
|
||||
});
|
||||
|
||||
let mut block_start = 0usize;
|
||||
|
||||
Reference in New Issue
Block a user