diff options
author | Andy Hung <hunga@google.com> | 2015-06-18 17:34:40 -0700 |
---|---|---|
committer | Andy Hung <hunga@google.com> | 2015-06-18 17:49:04 -0700 |
commit | 83ffcfb53b62489de9d2bd0b0277e879c3e57ab6 (patch) | |
tree | 8a4cae1ab38a419c70a18dbd6adc020d26f2110a /services | |
parent | bd974011599b6d4ff47c1cee36d617f191dc0c2f (diff) | |
download | frameworks_av-83ffcfb53b62489de9d2bd0b0277e879c3e57ab6.zip frameworks_av-83ffcfb53b62489de9d2bd0b0277e879c3e57ab6.tar.gz frameworks_av-83ffcfb53b62489de9d2bd0b0277e879c3e57ab6.tar.bz2 |
Fix clamp issue with AudioMixer with float input and int16 output
Bug: 20706338
Change-Id: I7e3ab0da96901870cc57fbe2e79163bc81157465
Diffstat (limited to 'services')
-rw-r--r-- | services/audioflinger/AudioMixerOps.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/services/audioflinger/AudioMixerOps.h b/services/audioflinger/AudioMixerOps.h index 2678857..8d74024 100644 --- a/services/audioflinger/AudioMixerOps.h +++ b/services/audioflinger/AudioMixerOps.h @@ -164,13 +164,12 @@ inline int32_t MixMul<int32_t, int16_t, float>(int16_t value, float volume) { template <> inline int16_t MixMul<int16_t, int16_t, float>(int16_t value, float volume) { LOG_ALWAYS_FATAL("MixMul<int16_t, int16_t, float> Runtime Should not be here"); - return value * volume; + return clamp16_from_float(MixMul<float, int16_t, float>(value, volume)); } template <> inline int16_t MixMul<int16_t, float, float>(float value, float volume) { - static const float q_15_from_float = (1 << 15); - return value * volume * q_15_from_float; + return clamp16_from_float(value * volume); } /* |