Skip to content

Commit

Permalink
Prevent potential hard crash in process_f64 call
Browse files Browse the repository at this point in the history
  • Loading branch information
helgoboss committed Sep 1, 2023
1 parent 85d6d51 commit 630a835
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions main/src/infrastructure/plugin/realearn_plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,17 +304,19 @@ impl Plugin for RealearnPlugin {
fn process_f64(&mut self, buffer: &mut AudioBuffer<f64>) {
#[cfg(not(feature = "playtime"))]
let _ = buffer;
assert_no_alloc(|| {
// Get current time information so we can detect changes in play state reliably
// (TimeInfoFlags::TRANSPORT_CHANGED doesn't work the way we want it).
self.was_playing_in_last_cycle = self.is_now_playing();
self.real_time_processor.lock_recover().run_from_vst(
#[cfg(feature = "playtime")]
buffer,
#[cfg(feature = "playtime")]
crate::domain::AudioBlockProps::from_vst(buffer, self.sample_rate),
&self.host,
);
firewall(|| {
assert_no_alloc(|| {
// Get current time information so we can detect changes in play state reliably
// (TimeInfoFlags::TRANSPORT_CHANGED doesn't work the way we want it).
self.was_playing_in_last_cycle = self.is_now_playing();
self.real_time_processor.lock_recover().run_from_vst(
#[cfg(feature = "playtime")]
buffer,
#[cfg(feature = "playtime")]
crate::domain::AudioBlockProps::from_vst(buffer, self.sample_rate),
&self.host,
);
});
});
}

Expand Down

0 comments on commit 630a835

Please sign in to comment.