From a5fc242946c8e15f26a7aa5cc2be9ea0d09b87bf Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Wed, 31 May 2006 22:37:28 +0000 Subject: Clip samp to 2047, not 2048, so that it stays positive when multiplied by 16. This seems to fix sound distortion in the Inherit the Earth demo. svn-id: r22812 --- sound/adpcm.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sound') diff --git a/sound/adpcm.cpp b/sound/adpcm.cpp index 9522e588d0..519d0d738c 100644 --- a/sound/adpcm.cpp +++ b/sound/adpcm.cpp @@ -266,9 +266,9 @@ int16 ADPCMInputStream::decodeOKI(byte code) { diff = (code & 0x08) ? -E : E; samp = _status.last + diff; - // Clip the values to +/- 2^11 (supposed to be 12 bits) - if (samp > 2048) - samp = 2048; + // Clip the values to +/- 2^11 (supposed to be 12 bits) + if (samp > 2047) + samp = 2047; if (samp < -2048) samp = -2048; -- cgit v1.2.3