summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-03-04 08:25:38 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-03-04 08:25:38 +0000
commitcf12d23f625fa7831e741c115c410a05c840f903 (patch)
tree72c6d8cd3bcded46ff70d94bf0cf2b8907c0b5d4
parenteb32795813c7e4fa51928d15313959c1fc1f6e36 (diff)
parentab5b51838c94afc60f9979cdde2117930ef90ea9 (diff)
downloadlibhardware-cf12d23f625fa7831e741c115c410a05c840f903.tar.gz
Snap for 4632767 from ab5b51838c94afc60f9979cdde2117930ef90ea9 to pi-release
Change-Id: Id24c270347d877f68c6c1f468a98615580562a13
-rw-r--r--modules/audio_remote_submix/audio_hw.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/audio_remote_submix/audio_hw.cpp b/modules/audio_remote_submix/audio_hw.cpp
index d78e723d..e826ac31 100644
--- a/modules/audio_remote_submix/audio_hw.cpp
+++ b/modules/audio_remote_submix/audio_hw.cpp
@@ -821,6 +821,11 @@ static ssize_t out_write(struct audio_stream_out *stream, const void* buffer,
written_frames = 0;
return 0;
+ } else if (written_frames == -EIO) {
+ // receiving -EIO means that the underlying FIFO has shut itself down
+ // due to reader/writer indices corruption. This state is irreversible,
+ // so shut down the monopipe. It will be destroyed on the next call to 'write.'
+ sink->shutdown(true);
} else {
// write() returned UNDERRUN or WOULD_BLOCK, retry
ALOGE("out_write() write to pipe returned unexpected %zd", written_frames);