mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
ensure that SLINEAR volume adjustments don't wrap around short integer maximums
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6882 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
4
frame.c
4
frame.c
@@ -1263,9 +1263,9 @@ int ast_frame_adjust_volume(struct ast_frame *f, int adjustment)
|
||||
|
||||
for (count = 0; count < f->samples; count++) {
|
||||
if (adjustment > 0) {
|
||||
fdata[count] *= abs(adjustment);
|
||||
ast_slinear_saturated_multiply(&fdata[count], abs(adjustment));
|
||||
} else if (adjustment < 0) {
|
||||
fdata[count] /= abs(adjustment);
|
||||
ast_slinear_saturated_divide(&fdata[count], abs(adjustment));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user