Playback: an infinite sample goes out as silence, not full scale

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon ThomasandClaude Opus 5.5 committed 2026-10-24 00:55:05 -04:00
1 parent ad7b9bcac6
commit 0888ca8ac3
1 file changed
+1 -2
+1 -2
View File
@@ -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.