mirror of
https://github.com/Genymobile/scrcpy
synced 2025-08-30 13:58:08 +00:00
Limit retry-on-error to IllegalStateException
MediaCodec errors always trigger IllegalStateException or a subtype (like MediaCodec.CodecException). In practice, this avoids to retry if the error is caused by an IOException when writing the video packet to the socket.
This commit is contained in:
@@ -99,7 +99,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 (Exception e) {
|
||||
} catch (IllegalStateException e) {
|
||||
Ln.e("Encoding error: " + e.getClass().getName() + ": " + e.getMessage());
|
||||
if (!downsizeOnError || firstFrameSent) {
|
||||
// Fail immediately
|
||||
|
Reference in New Issue
Block a user