Update input read to better handle errors
am: c85898721f
* commit 'c85898721f5c248676d97545fd65281d1201315b':
Update input read to better handle errors
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 296aaab..788e333 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -2066,7 +2066,9 @@
ALOGV("%s: read failed - sleeping for buffer duration", __func__);
usleep(bytes * 1000000 / audio_stream_in_frame_size(stream) /
in_get_sample_rate(&in->stream.common));
- } else {
+ memset(buffer, 0, bytes); // clear return data
+ }
+ if (bytes > 0) {
in->frames_read += bytes / audio_stream_in_frame_size(stream);
}
return bytes;