diff options
author | Glenn Kasten <gkasten@google.com> | 2013-12-19 08:56:45 -0800 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2013-12-20 08:40:55 -0800 |
commit | 74935e44734c1ec235c2b6677db3e0dbefa5ddb8 (patch) | |
tree | dc7bc2c9f496097e95ff36440fcd79886517ba53 /media/libmedia/AudioTrack.cpp | |
parent | bd72d22097f78f5bd668b223bc8c94e351311e31 (diff) | |
download | frameworks_av-74935e44734c1ec235c2b6677db3e0dbefa5ddb8.zip frameworks_av-74935e44734c1ec235c2b6677db3e0dbefa5ddb8.tar.gz frameworks_av-74935e44734c1ec235c2b6677db3e0dbefa5ddb8.tar.bz2 |
Replace control block frameCount_ by explicit in/out parameter
in IAudioFlinger::createTrack and IAudioFlinger::openRecord
Change-Id: I09c644c80e92c8e744b1b99055988a2588b2a83d
Diffstat (limited to 'media/libmedia/AudioTrack.cpp')
-rw-r--r-- | media/libmedia/AudioTrack.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index b48cb1f..74bb7a6 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -969,13 +969,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, @@ -1003,7 +1005,7 @@ status_t AudioTrack::createTrack_l( mCblkMemory = iMem; audio_track_cblk_t* cblk = static_cast<audio_track_cblk_t*>(iMem->pointer()); 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 |