summaryrefslogtreecommitdiffstats
path: root/media/libmedia/AudioRecord.cpp
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-11-14 13:42:25 -0800
committerGlenn Kasten <gkasten@google.com>2012-11-16 15:01:47 -0800
commitb603744e96b07b1d5bf745bde593fb2c025cefcf (patch)
tree0c8ae15dbd430ccfcb872c701de48907ec48afc8 /media/libmedia/AudioRecord.cpp
parentf91a3abb7d136e75f0f5d999193b8c8297d97628 (diff)
downloadframeworks_av-b603744e96b07b1d5bf745bde593fb2c025cefcf.zip
frameworks_av-b603744e96b07b1d5bf745bde593fb2c025cefcf.tar.gz
frameworks_av-b603744e96b07b1d5bf745bde593fb2c025cefcf.tar.bz2
Don't use control block frame count after create
This is part of a series to clean up the control block. Change-Id: I7f4cb05aef63053f8e2ab05b286d302260ef4758
Diffstat (limited to 'media/libmedia/AudioRecord.cpp')
-rw-r--r--media/libmedia/AudioRecord.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp
index 0587651..0731f00 100644
--- a/media/libmedia/AudioRecord.cpp
+++ b/media/libmedia/AudioRecord.cpp
@@ -216,7 +216,7 @@ status_t AudioRecord::set(
mFormat = format;
// Update buffer size in case it has been limited by AudioFlinger during track creation
- mFrameCount = mCblk->frameCount;
+ mFrameCount = mCblk->frameCount_;
mChannelCount = (uint8_t)channelCount;
mChannelMask = channelMask;
@@ -568,7 +568,7 @@ create_new_record:
}
uint32_t u = cblk->user;
- uint32_t bufferEnd = cblk->userBase + cblk->frameCount;
+ uint32_t bufferEnd = cblk->userBase + mFrameCount;
if (framesReq > bufferEnd - u) {
framesReq = bufferEnd - u;
@@ -584,7 +584,7 @@ create_new_record:
void AudioRecord::releaseBuffer(Buffer* audioBuffer)
{
AutoMutex lock(mLock);
- mCblk->stepUserIn(audioBuffer->frameCount);
+ mCblk->stepUserIn(audioBuffer->frameCount, mFrameCount);
}
audio_io_handle_t AudioRecord::getInput() const
@@ -746,7 +746,7 @@ bool AudioRecord::processAudioBuffer(const sp<AudioRecordThread>& thread)
// Manage overrun callback
- if (active && (cblk->framesAvailableIn() == 0)) {
+ if (active && (cblk->framesAvailableIn(mFrameCount) == 0)) {
// The value of active is stale, but we are almost sure to be active here because
// otherwise we would have exited when obtainBuffer returned STOPPED earlier.
ALOGV("Overrun user: %x, server: %x, flags %04x", cblk->user, cblk->server, cblk->flags);