We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c2175be commit ea9fe49Copy full SHA for ea9fe49
src/modules/capture/mod.rs
@@ -427,8 +427,12 @@ pub unsafe fn on_s_transfer_stereo_16(marker: MainThreadMarker, end: i32) {
427
.zip(buf.chunks_exact_mut(4))
428
{
429
// Clamping as done in Snd_WriteLinearBlastStereo16().
430
- let l16 = ((sample.left * volume) >> 8).min(32767).max(-32768) as i16;
431
- let r16 = ((sample.right * volume) >> 8).min(32767).max(-32768) as i16;
+ let l16 = ((sample.left.wrapping_mul(volume)) >> 8)
+ .min(32767)
432
+ .max(-32768) as i16;
433
+ let r16 = ((sample.right.wrapping_mul(volume)) >> 8)
434
435
436
437
buf[0..2].copy_from_slice(&l16.to_le_bytes());
438
buf[2..4].copy_from_slice(&r16.to_le_bytes());
0 commit comments