summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-05-07 07:50:07 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-05-07 07:50:07 -0700
commit7c6b6fbe4c2cf621844aba0c9b409f067f574ef0 (patch)
tree70c03f5a2efb4a8a98e010f5716fd008452ed6ff /media
parent5bd1d84aa81162754a20cf87d37e659a5e83fa3d (diff)
parenta6706b3c8f7e8759d5165535c95f6cd7147ab5e2 (diff)
downloadframeworks_base-7c6b6fbe4c2cf621844aba0c9b409f067f574ef0.zip
frameworks_base-7c6b6fbe4c2cf621844aba0c9b409f067f574ef0.tar.gz
frameworks_base-7c6b6fbe4c2cf621844aba0c9b409f067f574ef0.tar.bz2
am a6706b3: Merge change 1131 into donut
Merge commit 'a6706b3c8f7e8759d5165535c95f6cd7147ab5e2' * commit 'a6706b3c8f7e8759d5165535c95f6cd7147ab5e2': fix issue 1641535: SoundPool should use AudioTrack with shared memory buffer
Diffstat (limited to 'media')
-rw-r--r--media/jni/soundpool/SoundPool.cpp5
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;