From d538d6ae37acbcaf02f7fc452ecd80413b973366 Mon Sep 17 00:00:00 2001 From: olly Date: Tue, 14 Apr 2020 15:52:18 +0100 Subject: [PATCH] Fix capabilities check for low frame-rate content Issue: #6054 Issue: #474 PiperOrigin-RevId: 306437452 --- .../google/android/exoplayer2/mediacodec/MediaCodecInfo.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecInfo.java b/library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecInfo.java index 64517feec96..60c29f61831 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecInfo.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecInfo.java @@ -573,7 +573,9 @@ private static boolean areSizeAndRateSupportedV21(VideoCapabilities capabilities width = alignedSize.x; height = alignedSize.y; - if (frameRate == Format.NO_VALUE || frameRate <= 0) { + // VideoCapabilities.areSizeAndRateSupported incorrectly returns false if frameRate < 1 on some + // versions of Android, so we only check the size in this case [Internal ref: b/153940404]. + if (frameRate == Format.NO_VALUE || frameRate < 1) { return capabilities.isSizeSupported(width, height); } else { // The signaled frame rate may be slightly higher than the actual frame rate, so we take the