diff options
author | Andy Hung <hunga@google.com> | 2014-02-19 12:45:19 -0800 |
---|---|---|
committer | Andy Hung <hunga@google.com> | 2014-02-19 12:48:59 -0800 |
commit | 24781fff62a4cf7279d3dac83c33e2ac612712ba (patch) | |
tree | 8730de2f28936dca32643c5806e71c6bdc73f9f5 /services/audioflinger/AudioResamplerCubic.cpp | |
parent | 1ebd04b5f4ffe774c37054aac305cd9e6c73d2b2 (diff) | |
download | frameworks_av-24781fff62a4cf7279d3dac83c33e2ac612712ba.zip frameworks_av-24781fff62a4cf7279d3dac83c33e2ac612712ba.tar.gz frameworks_av-24781fff62a4cf7279d3dac83c33e2ac612712ba.tar.bz2 |
Fix resampler to allow output of single frame
Bug: 13073201
Change-Id: If7818a3389a191a37277bbd8e96a59ef8ce68509
Signed-off-by: Andy Hung <hunga@google.com>
Diffstat (limited to 'services/audioflinger/AudioResamplerCubic.cpp')
-rw-r--r-- | services/audioflinger/AudioResamplerCubic.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/services/audioflinger/AudioResamplerCubic.cpp b/services/audioflinger/AudioResamplerCubic.cpp index 1f9714b..8f14ff9 100644 --- a/services/audioflinger/AudioResamplerCubic.cpp +++ b/services/audioflinger/AudioResamplerCubic.cpp @@ -60,7 +60,7 @@ void AudioResamplerCubic::resampleStereo16(int32_t* out, size_t outFrameCount, uint32_t phaseIncrement = mPhaseIncrement; size_t outputIndex = 0; size_t outputSampleCount = outFrameCount * 2; - size_t inFrameCount = (outFrameCount*mInSampleRate)/mSampleRate; + size_t inFrameCount = getInFrameCountRequired(outFrameCount); // fetch first buffer if (mBuffer.frameCount == 0) { @@ -128,7 +128,7 @@ void AudioResamplerCubic::resampleMono16(int32_t* out, size_t outFrameCount, uint32_t phaseIncrement = mPhaseIncrement; size_t outputIndex = 0; size_t outputSampleCount = outFrameCount * 2; - size_t inFrameCount = (outFrameCount*mInSampleRate)/mSampleRate; + size_t inFrameCount = getInFrameCountRequired(outFrameCount); // fetch first buffer if (mBuffer.frameCount == 0) { |