summaryrefslogtreecommitdiffstats
path: root/media/libmedia
diff options
context:
space:
mode:
authorEric Laurent <>2009-03-24 18:56:19 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-24 18:56:19 -0700
commite0366d0b2fc9bb232efbe3672e2ae883dea9451c (patch)
treea5cab7aaaad0888d90478344c8520c7fecc9b310 /media/libmedia
parentc7daba1a642ed123272a79d19f2391071fe315dd (diff)
downloadframeworks_base-e0366d0b2fc9bb232efbe3672e2ae883dea9451c.zip
frameworks_base-e0366d0b2fc9bb232efbe3672e2ae883dea9451c.tar.gz
frameworks_base-e0366d0b2fc9bb232efbe3672e2ae883dea9451c.tar.bz2
Automated import from //branches/cupcake/...@142064,142064
Diffstat (limited to 'media/libmedia')
-rw-r--r--media/libmedia/AudioRecord.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp
index 5c800c3..986f88e 100644
--- a/media/libmedia/AudioRecord.cpp
+++ b/media/libmedia/AudioRecord.cpp
@@ -532,7 +532,14 @@ bool AudioRecord::processAudioBuffer(const sp<ClientRecordThread>& thread)
readSize = audioBuffer.size;
// Sanity check on returned size
- if (ssize_t(readSize) <= 0) break;
+ if (ssize_t(readSize) <= 0) {
+ // The callback is done filling buffers
+ // Keep this thread going to handle timed events and
+ // still try to get more data in intervals of WAIT_PERIOD_MS
+ // but don't just loop and block the CPU, so wait
+ usleep(WAIT_PERIOD_MS*1000);
+ break;
+ }
if (readSize > reqSize) readSize = reqSize;
audioBuffer.size = readSize;