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:
Kevin P. Fleming
2005-10-28 21:35:55 +00:00
parent c24ba6ac5e
commit 8dad624c68
2 changed files with 32 additions and 2 deletions

View File

@@ -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));
}
}