summaryrefslogtreecommitdiff
path: root/frame.c
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2005-10-28 21:35:55 +0000
committerKevin P. Fleming <kpfleming@digium.com>2005-10-28 21:35:55 +0000
commit8dad624c68b5f920f810f76e3b49741f991b6ae6 (patch)
tree516b6bc501ba5df920323c0dfd62cd355698de65 /frame.c
parentc24ba6ac5edf876e9c018faf2c604eb1e3b97d45 (diff)
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
Diffstat (limited to 'frame.c')
-rwxr-xr-xframe.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/frame.c b/frame.c
index 7b4fa4ddf..39bed2e01 100755
--- a/frame.c
+++ b/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));
}
}