summaryrefslogtreecommitdiffstats
path: root/media/jni/soundpool/SoundPool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'media/jni/soundpool/SoundPool.cpp')
-rw-r--r--media/jni/soundpool/SoundPool.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/media/jni/soundpool/SoundPool.cpp b/media/jni/soundpool/SoundPool.cpp
index 559f9d5..02731825 100644
--- a/media/jni/soundpool/SoundPool.cpp
+++ b/media/jni/soundpool/SoundPool.cpp
@@ -491,10 +491,11 @@ void SoundChannel::play(const sp<Sample>& sample, int nextChannelID, float leftV
// initialize track
int afFrameCount;
int afSampleRate;
- if (AudioSystem::getOutputFrameCount(&afFrameCount) != NO_ERROR) {
+ int streamType = mSoundPool->streamType();
+ if (AudioSystem::getOutputFrameCount(&afFrameCount, streamType) != NO_ERROR) {
afFrameCount = kDefaultFrameCount;
}
- if (AudioSystem::getOutputSamplingRate(&afSampleRate) != NO_ERROR) {
+ if (AudioSystem::getOutputSamplingRate(&afSampleRate, streamType) != NO_ERROR) {
afSampleRate = kDefaultSampleRate;
}
int numChannels = sample->numChannels();
@@ -522,10 +523,10 @@ void SoundChannel::play(const sp<Sample>& sample, int nextChannelID, float leftV
void *userData = (void *)((unsigned long)this | toggle);
#ifdef USE_SHARED_MEM_BUFFER
- newTrack = new AudioTrack(mSoundPool->streamType(), sampleRate, sample->format(),
+ newTrack = new AudioTrack(streamType, sampleRate, sample->format(),
numChannels, sample->getIMemory(), 0, callback, userData);
#else
- newTrack = new AudioTrack(mSoundPool->streamType(), sampleRate, sample->format(),
+ newTrack = new AudioTrack(streamType, sampleRate, sample->format(),
numChannels, frameCount, 0, callback, userData, bufferFrames);
#endif
if (newTrack->initCheck() != NO_ERROR) {