diff options
author | Chris Robinson <[email protected]> | 2010-11-30 16:54:30 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-11-30 16:54:30 -0800 |
commit | 3f8ae8f1cec86dbe19b13cafdffd76ff0da772cd (patch) | |
tree | 0d645f53393a2520523ab12d35d3dc96188ba90f /OpenAL32 | |
parent | a79129835c67a590cef31a5abb30b352015b0709 (diff) |
Fix IMA4 decoding
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/alBuffer.c | 9 |
1 files changed, 5 insertions, 4 deletions
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; } } |