diff options
author | Eric Laurent <elaurent@google.com> | 2009-05-07 03:14:31 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2009-05-07 03:14:31 -0700 |
commit | 9648e4b6774910afde095be94b8359ae80cd3dcb (patch) | |
tree | 8f427da17ab65eb1620e879c7f25ffeeee6b3fd3 /media/jni | |
parent | 05d24afb61e2fbd137468a065fd58685e1a62d78 (diff) | |
download | frameworks_base-9648e4b6774910afde095be94b8359ae80cd3dcb.zip frameworks_base-9648e4b6774910afde095be94b8359ae80cd3dcb.tar.gz frameworks_base-9648e4b6774910afde095be94b8359ae80cd3dcb.tar.bz2 |
fix issue 1641535: SoundPool should use AudioTrack with shared memory buffer
Enabled USE_SHARED_MEM_BUFFER switch in SoundPool.cpp
Diffstat (limited to 'media/jni')
-rw-r--r-- | media/jni/soundpool/SoundPool.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/media/jni/soundpool/SoundPool.cpp b/media/jni/soundpool/SoundPool.cpp index 02731825..0812650 100644 --- a/media/jni/soundpool/SoundPool.cpp +++ b/media/jni/soundpool/SoundPool.cpp @@ -18,7 +18,8 @@ #define LOG_TAG "SoundPool" #include <utils/Log.h> -//#define USE_SHARED_MEM_BUFFER +// +#define USE_SHARED_MEM_BUFFER // XXX needed for timing latency #include <utils/Timers.h> @@ -507,10 +508,12 @@ void SoundChannel::play(const sp<Sample>& 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; |