aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordhewg2011-03-11 20:43:38 +0100
committerdhewg2011-03-11 20:54:52 +0100
commita2a5083dc9bf51d92f7c001d60fc554b901eade0 (patch)
treebc2a2712a76ce8d1b212944e129ce76f59bf0563
parentba606e369338dcb77946f82ba02ed1ca266f28d5 (diff)
downloadscummvm-rg350-a2a5083dc9bf51d92f7c001d60fc554b901eade0.tar.gz
scummvm-rg350-a2a5083dc9bf51d92f7c001d60fc554b901eade0.tar.bz2
scummvm-rg350-a2a5083dc9bf51d92f7c001d60fc554b901eade0.zip
AUDIO: Work around ARM code volume limits
The ARM specific rate converters work with 8bit volume vars. Limit volumes to 0xff to prevent crackling.
-rw-r--r--audio/rate_arm.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/audio/rate_arm.cpp b/audio/rate_arm.cpp
index 41944ef698..d43a531129 100644
--- a/audio/rate_arm.cpp
+++ b/audio/rate_arm.cpp
@@ -320,6 +320,12 @@ int LinearRateConverter<stereo, reverseStereo>::flow(AudioStream &input, st_samp
#endif
st_sample_t *ostart = obuf;
+ if (vol_l > 0xff)
+ vol_l = 0xff;
+
+ if (vol_r > 0xff)
+ vol_r = 0xff;
+
if (!stereo) {
obuf = ARM_LinearRate_M(input,
&SimpleRate_readFudge,