diff --git a/package/android/src/main/java/com/mrousavy/camera/extensions/RecordingSession+getRecommendedBitRate.kt b/package/android/src/main/java/com/mrousavy/camera/extensions/RecordingSession+getRecommendedBitRate.kt index 5fa016b..9a4984b 100644 --- a/package/android/src/main/java/com/mrousavy/camera/extensions/RecordingSession+getRecommendedBitRate.kt +++ b/package/android/src/main/java/com/mrousavy/camera/extensions/RecordingSession+getRecommendedBitRate.kt @@ -31,7 +31,7 @@ fun RecordingSession.getRecommendedBitRate(fps: Int, codec: VideoCodec, hdr: Boo if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { val profiles = CamcorderProfile.getAll(cameraId, quality) if (profiles != null) { - val best = profiles.videoProfiles.filterNotNull().minBy { + val best = profiles.videoProfiles.filterNotNull().minByOrNull { abs(it.width * it.height - targetResolution.width * targetResolution.height) }