From 9648e4b6774910afde095be94b8359ae80cd3dcb Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Thu, 7 May 2009 03:14:31 -0700 Subject: [PATCH] fix issue 1641535: SoundPool should use AudioTrack with shared memory buffer Enabled USE_SHARED_MEM_BUFFER switch in SoundPool.cpp --- media/jni/soundpool/SoundPool.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/media/jni/soundpool/SoundPool.cpp b/media/jni/soundpool/SoundPool.cpp index 02731825e0879..0812650452bc4 100644 --- a/media/jni/soundpool/SoundPool.cpp +++ b/media/jni/soundpool/SoundPool.cpp @@ -18,7 +18,8 @@ #define LOG_TAG "SoundPool" #include -//#define USE_SHARED_MEM_BUFFER +// +#define USE_SHARED_MEM_BUFFER // XXX needed for timing latency #include @@ -507,10 +508,12 @@ void SoundChannel::play(const sp& sample, int nextChannelID, float leftV frameCount = sample->size()/numChannels/((sample->format() == AudioSystem::PCM_16_BIT) ? sizeof(int16_t) : sizeof(uint8_t)); } +#ifndef USE_SHARED_MEM_BUFFER // Ensure minimum audio buffer size in case of short looped sample if(frameCount < kDefaultBufferCount * bufferFrames) { frameCount = kDefaultBufferCount * bufferFrames; } +#endif AudioTrack* newTrack;