Fix the value of the silenced output for the u16 case (i.e. half of the maximum allowed value)

This commit is contained in:
Francesco Zardi 2018-04-18 23:42:42 +02:00
parent fb234e3ebb
commit b85626b3fb

View file

@ -75,7 +75,7 @@ fn audio_callback(engine: &Arc<Engine>, 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) } => {