diff options
author | Andy Hung <hunga@google.com> | 2015-03-17 22:55:46 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-03-17 22:55:47 +0000 |
commit | 377165c24968b044faccaf366a2377fa32143e2f (patch) | |
tree | 288f92e8a4368d68af7edebda91dd27d96c6b328 /media/libmedia/AudioRecord.cpp | |
parent | a1a847a509c5670276568d9945509677d92507ed (diff) | |
parent | fb7df2c355aad453f1978207e4116b2d4a61f34b (diff) | |
download | frameworks_av-377165c24968b044faccaf366a2377fa32143e2f.zip frameworks_av-377165c24968b044faccaf366a2377fa32143e2f.tar.gz frameworks_av-377165c24968b044faccaf366a2377fa32143e2f.tar.bz2 |
Merge "Fix periodic notification timing error for AudioRecord"
Diffstat (limited to 'media/libmedia/AudioRecord.cpp')
-rw-r--r-- | media/libmedia/AudioRecord.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp index 07ca14f..48abb96 100644 --- a/media/libmedia/AudioRecord.cpp +++ b/media/libmedia/AudioRecord.cpp @@ -863,8 +863,11 @@ nsecs_t AudioRecord::processAudioBuffer() if (!markerReached && position < markerPosition) { minFrames = markerPosition - position; } - if (updatePeriod > 0 && updatePeriod < minFrames) { - minFrames = updatePeriod; + if (updatePeriod > 0) { + uint32_t remaining = newPosition - position; + if (remaining < minFrames) { + minFrames = remaining; + } } // If > 0, poll periodically to recover from a stuck server. A good value is 2. |