Fix IMA ADPCM offset calculation

This commit is contained in:
Chris Robinson
2009-12-09 09:50:09 -08:00
parent a9fc272e39
commit bd696a6b37
+2 -2
View File
@@ -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)