mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-12-17 21:44:20 +01:00
Retry capture on IOException
If the capture fails with an IOException, retry with a lower resolution. Fixes #5539 <https://github.com/Genymobile/scrcpy/issues/5539>
This commit is contained in:
@@ -112,8 +112,8 @@ public class SurfaceEncoder implements AsyncProcessor {
|
|||||||
// The capture might have been closed internally (for example if the camera is disconnected)
|
// The capture might have been closed internally (for example if the camera is disconnected)
|
||||||
alive = !stopped.get() && !capture.isClosed();
|
alive = !stopped.get() && !capture.isClosed();
|
||||||
}
|
}
|
||||||
} catch (IllegalStateException | IllegalArgumentException e) {
|
} catch (IllegalStateException | IllegalArgumentException | IOException e) {
|
||||||
Ln.e("Encoding error: " + e.getClass().getName() + ": " + e.getMessage());
|
Ln.e("Capture/encoding error: " + e.getClass().getName() + ": " + e.getMessage());
|
||||||
if (!prepareRetry(size)) {
|
if (!prepareRetry(size)) {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user