am a6706b3: Merge change 1131 into donut
Merge commit 'a6706b3c8f7e8759d5165535c95f6cd7147ab5e2' * commit 'a6706b3c8f7e8759d5165535c95f6cd7147ab5e2': fix issue 1641535: SoundPool should use AudioTrack with shared memory buffer
This commit is contained in:
committed by
The Android Open Source Project
commit
7c6b6fbe4c
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user