summaryrefslogtreecommitdiffstats
path: root/media/libmedia/AudioRecord.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/AudioRecord.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/AudioRecord.cpp')
-rw-r--r--media/libmedia/AudioRecord.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp
index 6565a16..0673079 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;
@@ -467,11 +464,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,
@@ -503,6 +502,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) {