diff options
author | Hugo Hudson <hugohudson@google.com> | 2011-08-27 01:21:54 +0100 |
---|---|---|
committer | Hugo Hudson <hugohudson@google.com> | 2011-08-27 01:21:54 +0100 |
commit | d2772c48b3ba3cb78f814f83f4a65bbac2cf8337 (patch) | |
tree | fbc8422f24b5406f7571971c42b5124d8aa79c2d /variablespeed | |
parent | d96a96d8f74d1f83dba2f63e37149a13631be9fd (diff) | |
download | android_frameworks_ex-d2772c48b3ba3cb78f814f83f4a65bbac2cf8337.tar.gz android_frameworks_ex-d2772c48b3ba3cb78f814f83f4a65bbac2cf8337.tar.bz2 android_frameworks_ex-d2772c48b3ba3cb78f814f83f4a65bbac2cf8337.zip |
Fix the audio stutter during playback.
- Was using the base pointer from callback context when I meant to be
using the 'current position' pointer.
Bug: 5114126
Change-Id: Ie9baded973672cd8ac7ffe0f16f1bdf22c8f1030
Diffstat (limited to 'variablespeed')
-rw-r--r-- | variablespeed/jni/variablespeed.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/variablespeed/jni/variablespeed.cc b/variablespeed/jni/variablespeed.cc index 344eca5..e29846e 100644 --- a/variablespeed/jni/variablespeed.cc +++ b/variablespeed/jni/variablespeed.cc @@ -783,7 +783,7 @@ void AudioEngine::DecodingBufferQueueCallback( } { android::Mutex::Autolock autoLock(decodeBufferLock_); - decodeBuffer_.AddData(pCntxt->pDataBase, kBufferSizeInBytes); + decodeBuffer_.AddData(pCntxt->pData, kBufferSizeInBytes); } if (!HasSampleRateAndChannels()) { @@ -800,6 +800,8 @@ void AudioEngine::DecodingBufferQueueCallback( // ReadPosition(pCntxt->playItf); } + OpenSL(queueItf, Enqueue, pCntxt->pData, kBufferSizeInBytes); + // Increase data pointer by buffer size pCntxt->pData += kBufferSizeInBytes; if (pCntxt->pData >= pCntxt->pDataBase + @@ -807,8 +809,6 @@ void AudioEngine::DecodingBufferQueueCallback( pCntxt->pData = pCntxt->pDataBase; } - OpenSL(queueItf, Enqueue, pCntxt->pDataBase, kBufferSizeInBytes); - // If we get too much data into the decoder, // sleep until the playback catches up. while (!GetWasStopRequested() && DecodeBufferTooFull()) { |