From bc4537393b02b39433e07fed4ed57186d8e5959f Mon Sep 17 00:00:00 2001 From: Andy Hung Date: Tue, 17 Mar 2015 23:05:12 +0000 Subject: [PATCH] Revert "Revert "soundpool: update sample rate when reusing audiotrack"" This reverts commit b801f73343194cd081f675a5dc2b3e90959cf6d1. Change-Id: I0f6ee7fc981d65040f32e7852a5f66fd391b329d --- media/jni/soundpool/SoundPool.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/media/jni/soundpool/SoundPool.cpp b/media/jni/soundpool/SoundPool.cpp index 8957b3cb13626..dfe2844222a15 100644 --- a/media/jni/soundpool/SoundPool.cpp +++ b/media/jni/soundpool/SoundPool.cpp @@ -743,8 +743,10 @@ void SoundChannel::play(const sp& 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);