Bug 821495 - Add cast to silence unnecessary data loss compile warning in AudioSampleFormat.h. r=kinetik

This commit is contained in:
Chris Pearce 2012-12-14 12:11:50 +13:00
parent 6933f20fbc
commit 2e5f28125f

View File

@ -143,7 +143,7 @@ ScaleAudioSamples(float* aBuffer, int aCount, float aScale)
inline void
ScaleAudioSamples(short* aBuffer, int aCount, float aScale)
{
int32_t volume = int32_t(1 << 16) * aScale;
int32_t volume = int32_t((1 << 16) * aScale);
for (int32_t i = 0; i < aCount; ++i) {
aBuffer[i] = short((int32_t(aBuffer[i]) * volume) >> 16);
}