From bd696a6b37c2d8d05c3917cde180c95bcdbb630a Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 9 Dec 2009 09:50:09 -0800 Subject: Fix IMA ADPCM offset calculation --- OpenAL32/alSource.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenAL32/alSource.c') diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index 5a19f80a..f26d30ad 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -2077,9 +2077,9 @@ static ALint GetByteOffset(ALsource *pSource) (pBuffer->eOriginalFormat == AL_FORMAT_STEREO_IMA4)) { // Round down to nearest ADPCM block - lByteOffset = (pSource->lOffset / (36 * lChannels)) * 36 * lChannels; + lByteOffset = pSource->lOffset / (36 * lChannels); // Multiply by compression rate - lByteOffset = (ALint)(3.6111f * (ALfloat)lByteOffset); + lByteOffset = lByteOffset * 65 * lChannels * lBytes; lByteOffset -= (lByteOffset % (lChannels * lBytes)); } else if (pBuffer->eOriginalFormat == AL_FORMAT_REAR8) -- cgit v1.2.3