From 4c5c27dfc13ba19057292e9dc8a0b49733e913c4 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 10 Jul 2020 18:29:29 -0700 Subject: [PATCH] Re-enable the max operating rate trick on Android 10 except on the Mi 10 Lite 5G It still provides nice performance gains on Pixel 2 running Android 10 --- .../limelight/binding/video/MediaCodecHelper.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/limelight/binding/video/MediaCodecHelper.java b/app/src/main/java/com/limelight/binding/video/MediaCodecHelper.java index f9e6bbb4..d7ebe3d0 100644 --- a/app/src/main/java/com/limelight/binding/video/MediaCodecHelper.java +++ b/app/src/main/java/com/limelight/binding/video/MediaCodecHelper.java @@ -359,12 +359,14 @@ public class MediaCodecHelper { // some Qualcomm platforms. We could also set KEY_PRIORITY to 0 (realtime) // but that will actually result in the decoder crashing if it can't satisfy // our (ludicrous) operating rate requirement. This seems to cause reliable - // crashes on the Xiaomi Mi 10 lite 5G on Android 10, and probably isn't too - // useful in light of the qti-ext-dec-low-latency code. To be safe, we'll - // disable it on devices running Q or non-Qualcomm devices. + // crashes on the Xiaomi Mi 10 lite 5G on Android 10, so we'll disable it + // on that device and all non-Qualcomm devices to be safe. + // + // NB: Even on Android 10, this optimization still provides significant + // performance gains on Pixel 2. return Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && - Build.VERSION.SDK_INT < Build.VERSION_CODES.Q && - isDecoderInList(qualcommDecoderPrefixes, decoderName); + isDecoderInList(qualcommDecoderPrefixes, decoderName) && + !Build.DEVICE.equalsIgnoreCase("monet"); } public static boolean decoderSupportsAdaptivePlayback(MediaCodecInfo decoderInfo, String mimeType) {