diff --git a/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java b/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java index f97206ec..e95896d3 100644 --- a/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java +++ b/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java @@ -102,7 +102,7 @@ public class ScreenEncoder implements Device.RotationListener { alive = encode(codec, fd); // do not call stop() on exception, it would trigger an IllegalStateException codec.stop(); - } catch (IllegalStateException e) { + } catch (IllegalStateException | IllegalArgumentException e) { Ln.e("Encoding error: " + e.getClass().getName() + ": " + e.getMessage()); if (!downsizeOnError || firstFrameSent) { // Fail immediately