From 3f8ae8f1cec86dbe19b13cafdffd76ff0da772cd Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 30 Nov 2010 16:54:30 -0800 Subject: Fix IMA4 decoding --- OpenAL32/alBuffer.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'OpenAL32/alBuffer.c') diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c index bb2d36de..5b29bf03 100644 --- a/OpenAL32/alBuffer.c +++ b/OpenAL32/alBuffer.c @@ -885,16 +885,17 @@ static void DecodeIMA4Block(ALshort *dst, const ALubyte *IMAData, ALint numchans { for(c = 0;c < numchans;c++) { - Sample[c] += ((g_IMAStep_size[Index[c]]*g_IMACodeword_4[IMACode[c]&15])/8); + Sample[c] += g_IMAStep_size[Index[c]] * + g_IMACodeword_4[IMACode[c]&15] / 8; Index[c] += g_IMAIndex_adjust_4[IMACode[c]&15]; if(Sample[c] < -32768) Sample[c] = -32768; else if(Sample[c] > 32767) Sample[c] = 32767; - if(Index[c]<0) Index[c] = 0; - else if(Index[c]>88) Index[c] = 88; + if(Index[c] < 0) Index[c] = 0; + else if(Index[c] > 88) Index[c] = 88; - dst[(j+k)*numchans + c] = Sample[c]; + dst[j*numchans + c] = Sample[c]; IMACode[c] >>= 4; } } -- cgit v1.2.3