aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-12-09 09:50:09 -0800
committerChris Robinson <[email protected]>2009-12-09 09:50:09 -0800
commitbd696a6b37c2d8d05c3917cde180c95bcdbb630a (patch)
tree31ef59459bc0d88dea081137602caa22e6dfb3a9
parenta9fc272e390f9af4834df2efbca4fce76d4e632b (diff)
Fix IMA ADPCM offset calculation
-rw-r--r--OpenAL32/alSource.c4
1 files changed, 2 insertions, 2 deletions
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)