diff options
author | Andy Hung <hunga@google.com> | 2015-03-29 00:49:22 -0700 |
---|---|---|
committer | Andy Hung <hunga@google.com> | 2015-04-08 14:31:58 -0700 |
commit | 6b3b7e304e0f8f167241b2c75f1eb04a9ef192ec (patch) | |
tree | 1cec011ad26676dc9dc3eea778e18136c083e04f /services/audioflinger/AudioResamplerDyn.cpp | |
parent | 25f82752942b1c78aec8ee303d61afff85cff9d1 (diff) | |
download | frameworks_av-6b3b7e304e0f8f167241b2c75f1eb04a9ef192ec.zip frameworks_av-6b3b7e304e0f8f167241b2c75f1eb04a9ef192ec.tar.gz frameworks_av-6b3b7e304e0f8f167241b2c75f1eb04a9ef192ec.tar.bz2 |
Return number of frames output from resample method
Change-Id: Ic297e2ed59839f1788c83e099ef1a9e4af29591f
Diffstat (limited to 'services/audioflinger/AudioResamplerDyn.cpp')
-rw-r--r-- | services/audioflinger/AudioResamplerDyn.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/services/audioflinger/AudioResamplerDyn.cpp b/services/audioflinger/AudioResamplerDyn.cpp index c21d4ca..6481b85 100644 --- a/services/audioflinger/AudioResamplerDyn.cpp +++ b/services/audioflinger/AudioResamplerDyn.cpp @@ -477,15 +477,15 @@ void AudioResamplerDyn<TC, TI, TO>::setSampleRate(int32_t inSampleRate) } template<typename TC, typename TI, typename TO> -void AudioResamplerDyn<TC, TI, TO>::resample(int32_t* out, size_t outFrameCount, +size_t AudioResamplerDyn<TC, TI, TO>::resample(int32_t* out, size_t outFrameCount, AudioBufferProvider* provider) { - (this->*mResampleFunc)(reinterpret_cast<TO*>(out), outFrameCount, provider); + return (this->*mResampleFunc)(reinterpret_cast<TO*>(out), outFrameCount, provider); } template<typename TC, typename TI, typename TO> template<int CHANNELS, bool LOCKED, int STRIDE> -void AudioResamplerDyn<TC, TI, TO>::resample(TO* out, size_t outFrameCount, +size_t AudioResamplerDyn<TC, TI, TO>::resample(TO* out, size_t outFrameCount, AudioBufferProvider* provider) { // TODO Mono -> Mono is not supported. OUTPUT_CHANNELS reflects minimum of stereo out. @@ -610,6 +610,7 @@ resample_exit: ALOG_ASSERT(mBuffer.frameCount == 0); // there must be no frames in the buffer mInBuffer.setImpulse(impulse); mPhaseFraction = phaseFraction; + return outputIndex / OUTPUT_CHANNELS; } /* instantiate templates used by AudioResampler::create */ |