diff options
author | Andy Hung <hunga@google.com> | 2015-03-13 15:55:18 -0700 |
---|---|---|
committer | Andy Hung <hunga@google.com> | 2015-03-13 16:00:53 -0700 |
commit | fb7df2c355aad453f1978207e4116b2d4a61f34b (patch) | |
tree | 340a57f10bb7ae8a5c1b47cc0a799f949d73eead /media/libmedia/AudioRecord.cpp | |
parent | 1a86a8adbf4ab43a6aed2c3c8aa0830c001adb77 (diff) | |
download | frameworks_av-fb7df2c355aad453f1978207e4116b2d4a61f34b.zip frameworks_av-fb7df2c355aad453f1978207e4116b2d4a61f34b.tar.gz frameworks_av-fb7df2c355aad453f1978207e4116b2d4a61f34b.tar.bz2 |
Fix periodic notification timing error for AudioRecord
Change-Id: I768d8a30c6845372ad7c306ed1bc0ec030ae1804
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. |