From 6c307879b75f3eac2179b23ac309df0e4ce9cedd Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Wed, 13 May 2015 19:03:21 -0700 Subject: AudioTrack in SoundPool uses audio_attributes_t parameter Bug 20731155 Change-Id: I62ce9d5c5a88aaf534cfd1861378215f9253248d --- media/jni/soundpool/SoundPool.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'media/jni/soundpool') diff --git a/media/jni/soundpool/SoundPool.cpp b/media/jni/soundpool/SoundPool.cpp index 84ae3b4..6c1bd97 100644 --- a/media/jni/soundpool/SoundPool.cpp +++ b/media/jni/soundpool/SoundPool.cpp @@ -738,12 +738,16 @@ void SoundChannel::play(const sp& 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(), - channelMask, sample->getIMemory(), AUDIO_OUTPUT_FLAG_FAST, callback, userData); + channelMask, sample->getIMemory(), AUDIO_OUTPUT_FLAG_FAST, callback, userData, + 0 /*default notification frames*/, AUDIO_SESSION_ALLOCATE, + AudioTrack::TRANSFER_DEFAULT, + NULL /*offloadInfo*/, -1 /*uid*/, -1 /*pid*/, mSoundPool->attributes()); #else uint32_t bufferFrames = (totalFrames + (kDefaultBufferCount - 1)) / kDefaultBufferCount; newTrack = new AudioTrack(streamType, sampleRate, sample->format(), channelMask, frameCount, AUDIO_OUTPUT_FLAG_FAST, callback, userData, - bufferFrames); + bufferFrames, AUDIO_SESSION_ALLOCATE, AudioTrack::TRANSFER_DEFAULT, + NULL /*offloadInfo*/, -1 /*uid*/, -1 /*pid*/, mSoundPool->attributes()); #endif oldTrack = mAudioTrack; status = newTrack->initCheck(); -- cgit v1.1