Fix performance point check for Android M - P

This commit is contained in:
Cameron Gutman
2022-06-06 17:26:59 -05:00
parent d04e7a3231
commit d4490f0e17

View File

@@ -128,8 +128,9 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
try { try {
// We'll ask the decoder what it can do for us at this resolution and see if our // We'll ask the decoder what it can do for us at this resolution and see if our
// requested frame rate falls in the range of achievable frame rates. // requested frame rate falls below or inside the range of achievable frame rates.
return caps.getAchievableFrameRatesFor(prefs.width, prefs.height).contains((double) prefs.fps); Range<Double> fpsRange = caps.getAchievableFrameRatesFor(prefs.width, prefs.height);
return prefs.fps <= fpsRange.getUpper();
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
// Video size not supported at any frame rate // Video size not supported at any frame rate
return false; return false;