summaryrefslogtreecommitdiffstats
path: root/media/libmedia/SoundPool.cpp
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2013-09-18 10:33:39 -0700
committerGlenn Kasten <gkasten@google.com>2013-09-18 10:36:19 -0700
commit8d0fda9660aee7059f802f400875247b01226084 (patch)
tree57b68d45cbd4e4cafee6b19ae283e315341be3a1 /media/libmedia/SoundPool.cpp
parent6cc3a9948b51193dfdcb0c3527d7f3d1ca38aa3c (diff)
downloadframeworks_av-8d0fda9660aee7059f802f400875247b01226084.zip
frameworks_av-8d0fda9660aee7059f802f400875247b01226084.tar.gz
frameworks_av-8d0fda9660aee7059f802f400875247b01226084.tar.bz2
Partial fix for SoundPool not terminating
SoundPool was waiting for EVENT_UNDERRUN only to indicate end of clip. In J, AudioTrack delivered both EVENT_UNDERRUN followed by EVENT_BUFFER_END. However, as of K, AudioTrack is only delivering EVENT_BUFFER_END (this lack of EVENT_UNDERRUN is another bug which still needs to be fixed). The workaround is to also respond to EVENT_BUFFER_END in SoundPool. Bug: 10787103 Change-Id: Id68a23bddd6dd9df6c49c55138197260d71ca468
Diffstat (limited to 'media/libmedia/SoundPool.cpp')
-rw-r--r--media/libmedia/SoundPool.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/media/libmedia/SoundPool.cpp b/media/libmedia/SoundPool.cpp
index 0985164..5239b2f 100644
--- a/media/libmedia/SoundPool.cpp
+++ b/media/libmedia/SoundPool.cpp
@@ -740,8 +740,8 @@ void SoundChannel::process(int event, void *info, unsigned long toggle)
b->size = count;
//ALOGV("buffer=%p, [0]=%d", b->i16, b->i16[0]);
}
- } else if (event == AudioTrack::EVENT_UNDERRUN) {
- ALOGV("process %p channel %d EVENT_UNDERRUN", this, mChannelID);
+ } else if (event == AudioTrack::EVENT_UNDERRUN || event == AudioTrack::EVENT_BUFFER_END) {
+ ALOGV("process %p channel %d EVENT_UNDERRUN or EVENT_BUFFER_END", this, mChannelID);
mSoundPool->addToStopList(this);
} else if (event == AudioTrack::EVENT_LOOP_END) {
ALOGV("End loop %p channel %d count %d", this, mChannelID, *(int *)info);