From b85626b3fb148b1406827f10dd7a2f676a78e30e Mon Sep 17 00:00:00 2001 From: Francesco Zardi Date: Wed, 18 Apr 2018 23:42:42 +0200 Subject: [PATCH] Fix the value of the silenced output for the u16 case (i.e. half of the maximum allowed value) --- src/engine.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine.rs b/src/engine.rs index defd200..7368275 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -75,7 +75,7 @@ fn audio_callback(engine: &Arc, stream_id: StreamId, buffer: StreamData) match buffer { StreamData::Output { buffer: UnknownTypeOutputBuffer::U16(mut buffer) } => { for d in buffer.iter_mut() { - *d = mixer_rx.next().map(|s| s.to_u16()).unwrap_or(0u16); + *d = mixer_rx.next().map(|s| s.to_u16()).unwrap_or(u16::max_value() / 2); } }, StreamData::Output { buffer: UnknownTypeOutputBuffer::I16(mut buffer) } => {