corrected sound mixing for lower bound in addition to upper bound, but algorithm is still incorrect

git-svn-id: svn://anubis/anaglym/trunk@298 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
Josh Holtrop 2010-07-27 16:54:44 +00:00
parent 219b3f1f40
commit 8d8f753652

4
AV.cc
View File

@ -187,8 +187,8 @@ void AV::playCallback(Uint8 * stream, int len)
i < samples_decoded; i < samples_decoded;
i++) i++)
{ {
stream16[i] = int sample_val = stream16[i] + (int)(volume * m_sound_buffer[i]);
min(SHRT_MAX, stream16[i] + (int)(volume * m_sound_buffer[i])); stream16[i] = min(SHRT_MAX, max(SHRT_MIN, sample_val));
} }
} }
int sz = m_active_sounds.size(); int sz = m_active_sounds.size();