From 7901d1cc0af5484791ed22a70cdad8764b00b7d3 Mon Sep 17 00:00:00 2001 From: andrewlewis Date: Mon, 13 Nov 2023 06:42:46 -0800 Subject: [PATCH] Expand frame drop workaround to Realme C11 Based on on-device testing, this device seems to have the same issue as Moto G (20) where frames are dropped despite configuring the decoder not to drop frames. PiperOrigin-RevId: 581943805 (cherry picked from commit 330713f687d4ebaec9ee8e9aaf39db503f299ce3) --- .../src/main/java/androidx/media3/common/util/Util.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libraries/common/src/main/java/androidx/media3/common/util/Util.java b/libraries/common/src/main/java/androidx/media3/common/util/Util.java index ce4a165c1a..f46bee3255 100644 --- a/libraries/common/src/main/java/androidx/media3/common/util/Util.java +++ b/libraries/common/src/main/java/androidx/media3/common/util/Util.java @@ -3225,7 +3225,13 @@ public final class Util { // bounds. From API 29, if the app targets API 29 or later, the {@link // MediaFormat#KEY_ALLOW_FRAME_DROP} key prevents frame dropping even when the surface is // full. - return Util.SDK_INT < 29 || context.getApplicationInfo().targetSdkVersion < 29; + // Some API 30 devices might drop frames despite setting {@link + // MediaFormat#KEY_ALLOW_FRAME_DROP} to 0. See b/307518793 and b/289983935. + return SDK_INT < 29 + || context.getApplicationInfo().targetSdkVersion < 29 + || (SDK_INT == 30 + && (Ascii.equalsIgnoreCase(MODEL, "moto g(20)") + || Ascii.equalsIgnoreCase(MODEL, "rmx3231"))); } /**