summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Eric Laurent <elaurent@google.com> 2010-03-05 16:01:47 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2010-03-05 16:01:47 -0800
commit194e485dd1a6a38ce1bdd38589bafa637ce53c26 (patch)
tree7cc5ca350459a14cb3bcac780b7b38215f34d9b5
parent61a2c93ad93ffa63c7c39568c34b3fa284e622b4 (diff)
parent4f1fcc2890f7db5509740c3daedf51ee3a38869e (diff)
Merge "Fix issue 2428563: Camera rendered inoperable by voice call interruption."
-rw-r--r--libs/audioflinger/AudioFlinger.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/libs/audioflinger/AudioFlinger.cpp b/libs/audioflinger/AudioFlinger.cpp
index 2269352e5a..8089389ffc 100644
--- a/libs/audioflinger/AudioFlinger.cpp
+++ b/libs/audioflinger/AudioFlinger.cpp
@@ -3247,7 +3247,10 @@ bool AudioFlinger::RecordThread::threadLoop()
if (mBytesRead < 0) {
LOGE("Error reading audio input");
if (mActiveTrack->mState == TrackBase::ACTIVE) {
- sleep(1);
+ // Force input into standby so that it tries to
+ // recover at next read attempt
+ mInput->standby();
+ usleep(5000);
}
mRsmpInIndex = mFrameCount;
framesOut = 0;
@@ -3429,7 +3432,10 @@ status_t AudioFlinger::RecordThread::getNextBuffer(AudioBufferProvider::Buffer*
if (mBytesRead < 0) {
LOGE("RecordThread::getNextBuffer() Error reading audio input");
if (mActiveTrack->mState == TrackBase::ACTIVE) {
- sleep(1);
+ // Force input into standby so that it tries to
+ // recover at next read attempt
+ mInput->standby();
+ usleep(5000);
}
buffer->raw = 0;
buffer->frameCount = 0;