Skip to content

Display and control your Android device

Retry capture on IOException

Romain Vimont9555d3a537a8
diff --git a/server/src/main/java/com/genymobile/scrcpy/video/SurfaceEncoder.java b/server/src/main/java/com/genymobile/scrcpy/video/SurfaceEncoder.java
index bc120107..1402eceb 100644
--- a/server/src/main/java/com/genymobile/scrcpy/video/SurfaceEncoder.java
+++ b/server/src/main/java/com/genymobile/scrcpy/video/SurfaceEncoder.java
@@ -112,8 +112,8 @@ public class SurfaceEncoder implements AsyncProcessor {
// The capture might have been closed internally (for example if the camera is disconnected)
alive = !stopped.get() && !capture.isClosed();
}
- } catch (IllegalStateException | IllegalArgumentException e) {
- Ln.e("Encoding error: " + e.getClass().getName() + ": " + e.getMessage());
+ } catch (IllegalStateException | IllegalArgumentException | IOException e) {
+ Ln.e("Capture/encoding error: " + e.getClass().getName() + ": " + e.getMessage());
if (!prepareRetry(size)) {
throw e;
}