summaryrefslogtreecommitdiffstats
path: root/services/audioflinger
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2012-09-14 10:28:26 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-09-14 10:28:26 -0700
commitcb48dcf506e8ed9fbc5fae449ff014e495dff67d (patch)
tree1c14aa4248d5be72faa1e69a8d91474b6e5bc00e /services/audioflinger
parent7d21a0a5d9d5322c55786992bbd41b5a8e44d201 (diff)
parent868bb58ed5873edb1d138f82d4751823ef433ebb (diff)
downloadframeworks_av-cb48dcf506e8ed9fbc5fae449ff014e495dff67d.zip
frameworks_av-cb48dcf506e8ed9fbc5fae449ff014e495dff67d.tar.gz
frameworks_av-cb48dcf506e8ed9fbc5fae449ff014e495dff67d.tar.bz2
am 868bb58e: am 4362f530: Handle audio HAL returning 0 bytes in record thread
* commit '868bb58ed5873edb1d138f82d4751823ef433ebb': Handle audio HAL returning 0 bytes in record thread
Diffstat (limited to 'services/audioflinger')
-rw-r--r--services/audioflinger/AudioFlinger.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index a44fb3e..582ab65 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -5984,7 +5984,7 @@ bool AudioFlinger::RecordThread::threadLoop()
inputStandBy();
acquireWakeLock();
- // used to verify we've read at least one before evaluating how many bytes were read
+ // used to verify we've read at least once before evaluating how many bytes were read
bool readOnce = false;
// start recording
@@ -6499,9 +6499,9 @@ status_t AudioFlinger::RecordThread::getNextBuffer(AudioBufferProvider::Buffer*
if (framesReady == 0) {
mBytesRead = mInput->stream->read(mInput->stream, mRsmpInBuffer, mInputBytes);
- if (mBytesRead < 0) {
- ALOGE("RecordThread::getNextBuffer() Error reading audio input");
- if (mActiveTrack->mState == TrackBase::ACTIVE) {
+ if (mBytesRead <= 0) {
+ if ((mBytesRead < 0) && (mActiveTrack->mState == TrackBase::ACTIVE)) {
+ ALOGE("RecordThread::getNextBuffer() Error reading audio input");
// Force input into standby so that it tries to
// recover at next read attempt
inputStandBy();