Skip to content

Commit

Permalink
Ignore low-FPS ranges if not available
Browse files Browse the repository at this point in the history
Do not report an error if the returned FPS ranges array is null.

Refs #5669 <#5669>
  • Loading branch information
rom1v committed Dec 22, 2024
1 parent 2f44da7 commit 5387644
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/src/main/java/com/genymobile/scrcpy/util/LogUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Integer>[] lowFpsRanges = characteristics.get(CameraCharacteristics.CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES);
SortedSet<Integer> uniqueLowFps = getUniqueSet(lowFpsRanges);
builder.append(", fps=").append(uniqueLowFps);
if (lowFpsRanges != null) {
SortedSet<Integer> 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);
Expand Down

0 comments on commit 5387644

Please sign in to comment.