diff options
author | Glenn Kasten <gkasten@google.com> | 2013-09-11 14:35:16 -0700 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2013-09-11 14:36:52 -0700 |
commit | 8973c0439984f85870dffa7a100580271933c964 (patch) | |
tree | e664169db8c5c6a24e723e58b30b3feebafbf7d0 /media/libmedia | |
parent | c728c580fc512b50604f33f1c4581c500062b245 (diff) | |
download | frameworks_av-8973c0439984f85870dffa7a100580271933c964.zip frameworks_av-8973c0439984f85870dffa7a100580271933c964.tar.gz frameworks_av-8973c0439984f85870dffa7a100580271933c964.tar.bz2 |
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
Diffstat (limited to 'media/libmedia')
-rw-r--r-- | media/libmedia/SoundPool.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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 <utils/Log.h> -//#define USE_SHARED_MEM_BUFFER +#define USE_SHARED_MEM_BUFFER #include <media/AudioTrack.h> #include <media/mediaplayer.h> @@ -602,7 +602,7 @@ void SoundChannel::play(const sp<Sample>& 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, |