Skip to content

Commit

Permalink
Retry capture on IOException
Browse files Browse the repository at this point in the history
If the capture fails with an IOException, retry with a lower resolution.

Fixes Genymobile#5539 <Genymobile#5539>
  • Loading branch information
rom1v committed Dec 3, 2024
1 parent aea6a37 commit 9b620b5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ private void streamCapture() throws IOException, ConfigurationException {
// 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;
}
Expand Down

0 comments on commit 9b620b5

Please sign in to comment.