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/AudioRecord.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/AudioRecord.cpp')
-rw-r--r-- | media/libmedia/AudioRecord.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp index 666fafa..13c9f60 100644 --- a/media/libmedia/AudioRecord.cpp +++ b/media/libmedia/AudioRecord.cpp @@ -255,9 +255,6 @@ status_t AudioRecord::set( mStatus = NO_ERROR; - // Update buffer size in case it has been limited by AudioFlinger during track creation - mFrameCount = mCblk->frameCount_; - mActive = false; mCbf = cbf; mRefreshRemaining = true; @@ -462,11 +459,13 @@ status_t AudioRecord::openRecord_l(size_t epoch) return BAD_VALUE; } + size_t temp = mFrameCount; // temp may be replaced by a revised value of frameCount, + // but we will still need the original value also int originalSessionId = mSessionId; sp<IAudioRecord> record = audioFlinger->openRecord(input, mSampleRate, mFormat, mChannelMask, - mFrameCount, + &temp, &trackFlags, tid, &mSessionId, @@ -498,6 +497,12 @@ status_t AudioRecord::openRecord_l(size_t epoch) mCblkMemory = iMem; audio_track_cblk_t* cblk = static_cast<audio_track_cblk_t*>(iMemPointer); mCblk = cblk; + // note that temp is the (possibly revised) value of mFrameCount + if (temp < mFrameCount || (mFrameCount == 0 && temp == 0)) { + ALOGW("Requested frameCount %u but received frameCount %u", mFrameCount, temp); + } + mFrameCount = temp; + // FIXME missing fast track frameCount logic mAwaitBoost = false; if (mFlags & AUDIO_INPUT_FLAG_FAST) { |