From 538764416099c803fcb041ecffa2c849829b7222 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Sun, 22 Dec 2024 21:17:51 +0100 Subject: [PATCH] Ignore low-FPS ranges if not available Do not report an error if the returned FPS ranges array is null. Refs #5669 --- .../src/main/java/com/genymobile/scrcpy/util/LogUtils.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/com/genymobile/scrcpy/util/LogUtils.java b/server/src/main/java/com/genymobile/scrcpy/util/LogUtils.java index 961b8da023..701ae373e5 100644 --- a/server/src/main/java/com/genymobile/scrcpy/util/LogUtils.java +++ b/server/src/main/java/com/genymobile/scrcpy/util/LogUtils.java @@ -163,8 +163,10 @@ public static String buildCameraListMessage(boolean includeSizes) { try { // Capture frame rates for low-FPS mode are the same for every resolution Range[] lowFpsRanges = characteristics.get(CameraCharacteristics.CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES); - SortedSet uniqueLowFps = getUniqueSet(lowFpsRanges); - builder.append(", fps=").append(uniqueLowFps); + if (lowFpsRanges != null) { + SortedSet uniqueLowFps = getUniqueSet(lowFpsRanges); + builder.append(", fps=").append(uniqueLowFps); + } } catch (Exception e) { // Some devices may provide invalid ranges, causing an IllegalArgumentException "lower must be less than or equal to upper" Ln.w("Could not get available frame rates for camera " + id, e);