summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioResamplerCubic.cpp
diff options
context:
space:
mode:
authorJohn Grossman <johngro@google.com>2012-02-08 16:37:41 -0800
committerJohn Grossman <johngro@google.com>2012-02-16 13:45:11 -0800
commit4ff14bae91075eb274eb1c2975982358946e7e63 (patch)
treee9e54fddb9832d30b69c2a11c9ed2884397f2f95 /services/audioflinger/AudioResamplerCubic.cpp
parent951bd8d1ad9581a414e171ad8605a9515d0ad667 (diff)
downloadframeworks_av-4ff14bae91075eb274eb1c2975982358946e7e63.zip
frameworks_av-4ff14bae91075eb274eb1c2975982358946e7e63.tar.gz
frameworks_av-4ff14bae91075eb274eb1c2975982358946e7e63.tar.bz2
Upintegrate Audio Flinger changes from ICS_AAH
Bring in changes to audio flinger made to support timed audio tracks and HW master volume control. Change-Id: Ide52d48809bdbed13acf35fd59b24637e35064ae Signed-off-by: John Grossman <johngro@google.com>
Diffstat (limited to 'services/audioflinger/AudioResamplerCubic.cpp')
-rw-r--r--services/audioflinger/AudioResamplerCubic.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/services/audioflinger/AudioResamplerCubic.cpp b/services/audioflinger/AudioResamplerCubic.cpp
index c0e760e..18e59e9 100644
--- a/services/audioflinger/AudioResamplerCubic.cpp
+++ b/services/audioflinger/AudioResamplerCubic.cpp
@@ -65,7 +65,7 @@ void AudioResamplerCubic::resampleStereo16(int32_t* out, size_t outFrameCount,
// fetch first buffer
if (mBuffer.frameCount == 0) {
mBuffer.frameCount = inFrameCount;
- provider->getNextBuffer(&mBuffer);
+ provider->getNextBuffer(&mBuffer, mPTS);
if (mBuffer.raw == NULL)
return;
// ALOGW("New buffer: offset=%p, frames=%dn", mBuffer.raw, mBuffer.frameCount);
@@ -95,7 +95,8 @@ void AudioResamplerCubic::resampleStereo16(int32_t* out, size_t outFrameCount,
inputIndex = 0;
provider->releaseBuffer(&mBuffer);
mBuffer.frameCount = inFrameCount;
- provider->getNextBuffer(&mBuffer);
+ provider->getNextBuffer(&mBuffer,
+ calculateOutputPTS(outputIndex / 2));
if (mBuffer.raw == NULL)
goto save_state; // ugly, but efficient
in = mBuffer.i16;
@@ -130,7 +131,7 @@ void AudioResamplerCubic::resampleMono16(int32_t* out, size_t outFrameCount,
// fetch first buffer
if (mBuffer.frameCount == 0) {
mBuffer.frameCount = inFrameCount;
- provider->getNextBuffer(&mBuffer);
+ provider->getNextBuffer(&mBuffer, mPTS);
if (mBuffer.raw == NULL)
return;
// ALOGW("New buffer: offset=%p, frames=%d", mBuffer.raw, mBuffer.frameCount);
@@ -160,7 +161,8 @@ void AudioResamplerCubic::resampleMono16(int32_t* out, size_t outFrameCount,
inputIndex = 0;
provider->releaseBuffer(&mBuffer);
mBuffer.frameCount = inFrameCount;
- provider->getNextBuffer(&mBuffer);
+ provider->getNextBuffer(&mBuffer,
+ calculateOutputPTS(outputIndex / 2));
if (mBuffer.raw == NULL)
goto save_state; // ugly, but efficient
// ALOGW("New buffer: offset=%p, frames=%dn", mBuffer.raw, mBuffer.frameCount);
@@ -181,4 +183,3 @@ save_state:
// ----------------------------------------------------------------------------
}
; // namespace android
-