Update mReqFrameCount at same point in AudioTrack and AudioRecord
Change-Id: I12369dfbb9e75389f2cab015a706decdaf310a0d
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp
index e18819c..bb0d196 100644
--- a/media/libmedia/AudioRecord.cpp
+++ b/media/libmedia/AudioRecord.cpp
@@ -523,11 +523,6 @@
ALOGW("Requested frameCount %u but received frameCount %u", frameCount, temp);
}
frameCount = temp;
- // If IAudioRecord is re-created, don't let the requested frameCount
- // decrease. This can confuse clients that cache frameCount().
- if (frameCount > mReqFrameCount) {
- mReqFrameCount = frameCount;
- }
// FIXME missing fast track frameCount logic
mAwaitBoost = false;
@@ -553,6 +548,11 @@
void *buffers = (char*)cblk + sizeof(audio_track_cblk_t);
mFrameCount = frameCount;
+ // If IAudioRecord is re-created, don't let the requested frameCount
+ // decrease. This can confuse clients that cache frameCount().
+ if (frameCount > mReqFrameCount) {
+ mReqFrameCount = frameCount;
+ }
// update proxy
mProxy = new AudioRecordClientProxy(cblk, buffers, mFrameCount, mFrameSize);