From 8973c0439984f85870dffa7a100580271933c964 Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Wed, 11 Sep 2013 14:35:16 -0700 Subject: Fix SoundPool.play() looping This is done by configuring SoundPool for shared memory and fast track. Previously SoundPool used a streaming track, and looping in streaming mode relied on the ability to loop the most recently enqueued data. That 'feature' was lost in the new implementation of streaming, so we're now switching from streaming mode to shared memory mode. Shared memory mode had always been desired, but was blocked by bug 2801375 which is fixed now. Bug: 10171337 Change-Id: I2a938e3ffafa2a74d5210b4198b50db20ad5da0e --- media/libmedia/SoundPool.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'media/libmedia/SoundPool.cpp') diff --git a/media/libmedia/SoundPool.cpp b/media/libmedia/SoundPool.cpp index 7f10e05..0985164 100644 --- a/media/libmedia/SoundPool.cpp +++ b/media/libmedia/SoundPool.cpp @@ -18,7 +18,7 @@ #define LOG_TAG "SoundPool" #include -//#define USE_SHARED_MEM_BUFFER +#define USE_SHARED_MEM_BUFFER #include #include @@ -602,7 +602,7 @@ void SoundChannel::play(const sp& sample, int nextChannelID, float leftV // do not create a new audio track if current track is compatible with sample parameters #ifdef USE_SHARED_MEM_BUFFER newTrack = new AudioTrack(streamType, sampleRate, sample->format(), - channels, sample->getIMemory(), AUDIO_OUTPUT_FLAG_NONE, callback, userData); + channels, sample->getIMemory(), AUDIO_OUTPUT_FLAG_FAST, callback, userData); #else newTrack = new AudioTrack(streamType, sampleRate, sample->format(), channels, frameCount, AUDIO_OUTPUT_FLAG_FAST, callback, userData, -- cgit v1.1