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:
parent
fd28a95231
commit
5cbef6ec03
1 changed files with 7 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue