Opened 22 years ago

Closed 22 years ago

Last modified 6 years ago

#8131 closed patch

ALL: Fix for possible mixer distortion

Reported by: eriktorbjorn Owned by: fingolfin
Priority: normal Component: Audio
Version: Keywords:
Cc: Game:

Description

It looks to me as if there is a potential for arithmetic overflow in the mixer with some of the channel types. In reality I've only managed to provoke a few popping sounds when cranking up all the volume controls to their maximum setting, but I still think it'd be safer to use clamped_add_16() than to just add the sample to the buffer and assume it will work.

Ticket imported from: #639931. Ticket imported from: patches/236.

Attachments (1)

mixer.diff (1.4 KB ) - added by eriktorbjorn 22 years ago.
Patch against a November 17 CVS snapshot

Download all attachments as: .zip

Change History (4)

by eriktorbjorn, 22 years ago

Attachment: mixer.diff added

Patch against a November 17 CVS snapshot

comment:1 by fingolfin, 22 years ago

Owner: set to fingolfin
Status: newclosed

comment:2 by fingolfin, 22 years ago

Done.

BTW, the clamp_add_16 function is quite crude, it cuts of "hard", a better implemention would do it slightly "smoothed", in order to reduce artifacts a little.

comment:3 by digitall, 6 years ago

Component: Audio
Note: See TracTickets for help on using tickets.