fix: Fix NoSuchElementException
in getRecommendedBitRate
(#2266)
* Remove unused hasConstants method. Do no thrown error on minBy call when filterd videoProfiles contains zero items. * Remove not related to the fix changes.
This commit is contained in:
parent
4ee52d6211
commit
a612eb9d38
@ -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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user