summaryrefslogtreecommitdiffstats
path: root/media/libmedia/AudioTrack.cpp
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2014-01-24 16:13:50 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-01-24 16:13:51 +0000
commitf0002d142e6d24c5438600b2c259679de710f8ac (patch)
tree20e5013fa14f2d5339868c1b08396f7b852a2123 /media/libmedia/AudioTrack.cpp
parentc69b91ceae6255e41c5413796fb0ed4f7af45b15 (diff)
parent74935e44734c1ec235c2b6677db3e0dbefa5ddb8 (diff)
downloadframeworks_av-f0002d142e6d24c5438600b2c259679de710f8ac.zip
frameworks_av-f0002d142e6d24c5438600b2c259679de710f8ac.tar.gz
frameworks_av-f0002d142e6d24c5438600b2c259679de710f8ac.tar.bz2
Merge "Replace control block frameCount_ by explicit in/out parameter"
Diffstat (limited to 'media/libmedia/AudioTrack.cpp')
-rw-r--r--media/libmedia/AudioTrack.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp
index 72be5ca..c8dc38b 100644
--- a/media/libmedia/AudioTrack.cpp
+++ b/media/libmedia/AudioTrack.cpp
@@ -1000,13 +1000,15 @@ status_t AudioTrack::createTrack_l(
trackFlags |= IAudioFlinger::TRACK_OFFLOAD;
}
+ size_t temp = frameCount; // temp may be replaced by a revised value of frameCount,
+ // but we will still need the original value also
sp<IAudioTrack> track = audioFlinger->createTrack(streamType,
sampleRate,
// AudioFlinger only sees 16-bit PCM
format == AUDIO_FORMAT_PCM_8_BIT ?
AUDIO_FORMAT_PCM_16_BIT : format,
mChannelMask,
- frameCount,
+ &temp,
&trackFlags,
sharedBuffer,
output,
@@ -1039,7 +1041,7 @@ status_t AudioTrack::createTrack_l(
mCblkMemory = iMem;
audio_track_cblk_t* cblk = static_cast<audio_track_cblk_t*>(iMemPointer);
mCblk = cblk;
- size_t temp = cblk->frameCount_;
+ // note that temp is the (possibly revised) value of frameCount
if (temp < frameCount || (frameCount == 0 && temp == 0)) {
// In current design, AudioTrack client checks and ensures frame count validity before
// passing it to AudioFlinger so AudioFlinger should not return a different value except