From 0888ca8ac3b220a239be2d4221ef13999d9151bb Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sat, 24 Oct 2026 00:54:53 -0400 Subject: [PATCH] Playback: an infinite sample goes out as silence, not full scale Co-Authored-By: Claude Opus 5.5 --- crates/playback/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/playback/src/lib.rs b/crates/playback/src/lib.rs index bb77e13d..8195640c 100644 --- a/crates/playback/src/lib.rs +++ b/crates/playback/src/lib.rs @@ -399,8 +399,7 @@ impl AudioState { /// Clamp to the device range, mapping NaN and infinities to silence. fn out_sample(v: f32) -> f32 { - let v = v.clamp(-1.0, 1.0); - if v.is_finite() { v } else { 0.0 } + if v.is_finite() { v.clamp(-1.0, 1.0) } else { 0.0 } } /// UI-thread bookkeeping of the third-party instances the audio thread holds.