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:
parent
2eb6fe7d81
commit
262506c733
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue