Skip to content

Commit

Permalink
Also retry on IllegalArgumentException
Browse files Browse the repository at this point in the history
MediaCodec.configure() may throw an IllegalArgumentException if it does
not support the requested size. Also retry on this exception.

Fixes #2993 <#2993>
Refs #2947 <#2947>
Refs #2990 <#2990>
PR #3043 <#3043>
  • Loading branch information
rom1v committed Feb 20, 2022
1 parent 36c75e1 commit 0217282
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private void internalStreamScreen(Device device, FileDescriptor fd) throws IOExc
alive = encode(codec, fd);
// do not call stop() on exception, it would trigger an IllegalStateException
codec.stop();
} catch (IllegalStateException e) {
} catch (IllegalStateException | IllegalArgumentException e) {
Ln.e("Encoding error: " + e.getClass().getName() + ": " + e.getMessage());
if (!downsizeOnError || firstFrameSent) {
// Fail immediately
Expand Down

0 comments on commit 0217282

Please sign in to comment.