diff --git a/stream-webrtc-android/src/main/java/org/webrtc/AndroidVideoDecoder.java b/stream-webrtc-android/src/main/java/org/webrtc/AndroidVideoDecoder.java index ad40898e..564e66c3 100644 --- a/stream-webrtc-android/src/main/java/org/webrtc/AndroidVideoDecoder.java +++ b/stream-webrtc-android/src/main/java/org/webrtc/AndroidVideoDecoder.java @@ -283,7 +283,12 @@ public VideoCodecStatus decode(EncodedImage frame, DecodeInfo info) { } catch (IllegalStateException e) { Logging.e(TAG, "queueInputBuffer failed", e); frameInfos.pollLast(); - return VideoCodecStatus.ERROR; + if (e instanceof MediaCodec.CodecException) { + // For codec exceptions we can try to use the software fallback + return VideoCodecStatus.FALLBACK_SOFTWARE; + } else { + return VideoCodecStatus.ERROR; + } } if (keyFrameRequired) { keyFrameRequired = false;