From 4eb33054cda35043983b57eb37395cbdac8724eb Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Sat, 11 Nov 2023 11:14:01 +0100 Subject: [PATCH] Do not log EPIPE on close for raw audio Handle EPIPE the same way in AudioRawRecorder as in AudioEncoder. This prevents useless errors on close. --- .../main/java/com/genymobile/scrcpy/AudioRawRecorder.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/src/main/java/com/genymobile/scrcpy/AudioRawRecorder.java b/server/src/main/java/com/genymobile/scrcpy/AudioRawRecorder.java index fdac8b3a..ce33ae85 100644 --- a/server/src/main/java/com/genymobile/scrcpy/AudioRawRecorder.java +++ b/server/src/main/java/com/genymobile/scrcpy/AudioRawRecorder.java @@ -51,6 +51,11 @@ public final class AudioRawRecorder implements AsyncProcessor { streamer.writePacket(buffer, bufferInfo); } + } catch (IOException e) { + // Broken pipe is expected on close, because the socket is closed by the client + if (!IO.isBrokenPipe(e)) { + Ln.e("Audio capture error", e); + } } finally { capture.stop(); }