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:
parent
219b3f1f40
commit
8d8f753652
4
AV.cc
4
AV.cc
@ -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();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user