From 23710e04c12b9f155384860df34176063942a88a Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Thu, 12 Feb 2026 20:12:18 +0100 Subject: [PATCH] Disable audio stream with fatal error Throwable Only an AudioCaptureException should disable the audio stream without making scrcpy exit (it is not a fatal error). A ConfigurationException or any other Throwable must be considered a fatal error. BEFORE AFTER AudioCaptureException: non-fatal non-fatal ConfigurationException: fatal fatal any other Throwable: non-fatal fatal Refs #6600 comment --- .../java/com/genymobile/scrcpy/audio/AudioEncoder.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/src/main/java/com/genymobile/scrcpy/audio/AudioEncoder.java b/server/src/main/java/com/genymobile/scrcpy/audio/AudioEncoder.java index 33177228..a8e9c708 100644 --- a/server/src/main/java/com/genymobile/scrcpy/audio/AudioEncoder.java +++ b/server/src/main/java/com/genymobile/scrcpy/audio/AudioEncoder.java @@ -266,14 +266,14 @@ public final class AudioEncoder implements AsyncProcessor { outputThread.start(); waitEnded(); - } catch (ConfigurationException e) { - // Notify the error to make scrcpy exit - streamer.writeDisableStream(true); - throw e; - } catch (Throwable e) { + } catch (AudioCaptureException e) { // Notify the client that the audio could not be captured streamer.writeDisableStream(false); throw e; + } catch (Throwable e) { + // Notify the error to make scrcpy exit + streamer.writeDisableStream(true); + throw e; } finally { // Cleanup everything (either at the end or on error at any step of the initialization) if (mediaCodecThread != null) {