Skip to content
Snippets Groups Projects
Commit 15ac7617 authored by Kevin P. Fleming's avatar Kevin P. Fleming
Browse files

do saturated math properly (thanks to the eagle-eyes of Tony Mountifield)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6888 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 80fb221f
No related branches found
No related tags found
No related merge requests found
......@@ -173,7 +173,7 @@ static inline void ast_slinear_saturated_add(short *input, short value)
{
int res;
res = *input + value;
res = (int) *input + value;
if (res > 32767)
*input = 32767;
else if (res < -32767)
......@@ -186,7 +186,7 @@ static inline void ast_slinear_saturated_multiply(short *input, short value)
{
int res;
res = *input * value;
res = (int) *input * value;
if (res > 32767)
*input = 32767;
else if (res < -32767)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment