diff options
author | Dhananjay Kumar <dhakumar@codeaurora.org> | 2015-03-03 22:00:32 +0530 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2015-03-04 09:22:18 -0800 |
commit | a7d57a6f0068b1e2a0f07ca427cfba198b12a9b9 (patch) | |
tree | 036000dc26fb4abb73c799990ea4256becc6d446 /media/jni | |
parent | 570576b51b8123ab05b36707ec752cf966292ca5 (diff) | |
download | frameworks_base-a7d57a6f0068b1e2a0f07ca427cfba198b12a9b9.zip frameworks_base-a7d57a6f0068b1e2a0f07ca427cfba198b12a9b9.tar.gz frameworks_base-a7d57a6f0068b1e2a0f07ca427cfba198b12a9b9.tar.bz2 |
soundpool: update sample rate when reusing audiotrack
User might update playback rate while calling Play on a sample.
Update sample rate if reusing existing audio track.
Change-Id: I7007c335fa405baf663a322408b92b9df53efdb0
Signed-off-by: Glenn Kasten <gkasten@google.com>
Diffstat (limited to 'media/jni')
-rw-r--r-- | media/jni/soundpool/SoundPool.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/media/jni/soundpool/SoundPool.cpp b/media/jni/soundpool/SoundPool.cpp index 8957b3c..dfe2844 100644 --- a/media/jni/soundpool/SoundPool.cpp +++ b/media/jni/soundpool/SoundPool.cpp @@ -743,8 +743,10 @@ void SoundChannel::play(const sp<Sample>& sample, int nextChannelID, float leftV // From now on, AudioTrack callbacks received with previous toggle value will be ignored. mToggle = toggle; mAudioTrack = newTrack; + ALOGV("using new track %p for sample %d", newTrack.get(), sample->sampleID()); } else { newTrack = mAudioTrack; + newTrack->setSampleRate(sampleRate); ALOGV("reusing track %p for sample %d", mAudioTrack.get(), sample->sampleID()); } newTrack->setVolume(leftVolume, rightVolume); |