From cd04484f4837b8ca0041d118286ab6a98e84fc75 Mon Sep 17 00:00:00 2001 From: Andy Hung Date: Thu, 7 Aug 2014 11:04:34 -0700 Subject: Extend downsampling ratios greater than 2:1 Also improve robustness to choice of sampling rate or buffer size such that increasing either by 10x does not cause overflow. Bug: 12979141 Bug: 15933066 Change-Id: If7989bd745d1bee3bdf811b8b7c978543ccafb65 --- services/audioflinger/AudioResamplerDyn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'services/audioflinger/AudioResamplerDyn.cpp') diff --git a/services/audioflinger/AudioResamplerDyn.cpp b/services/audioflinger/AudioResamplerDyn.cpp index 159ab70..0eeb201 100644 --- a/services/audioflinger/AudioResamplerDyn.cpp +++ b/services/audioflinger/AudioResamplerDyn.cpp @@ -393,7 +393,7 @@ void AudioResamplerDyn::setSampleRate(int32_t inSampleRate) mPhaseFraction = static_cast(mPhaseFraction) * phaseWrapLimit / oldPhaseWrapLimit; mPhaseFraction %= phaseWrapLimit; // should not do anything, but just in case. - mPhaseIncrement = static_cast(static_cast(phaseWrapLimit) + mPhaseIncrement = static_cast(static_cast(phaseWrapLimit) * inSampleRate / mSampleRate); // determine which resampler to use -- cgit v1.1