Issue #38 : extra defensive -- don't even assume the list is sorted in case of buggy phones

This commit is contained in:
Sean Owen 2014-01-24 20:23:16 +00:00
parent e174140d8d
commit a8c9897da3

View file

@ -239,9 +239,11 @@ final class CameraConfigurationManager {
if (supportedPreviewFpsRanges != null && !supportedPreviewFpsRanges.isEmpty()) {
int[] minimumSuitableFpsRange = null;
for (int[] fpsRange : supportedPreviewFpsRanges) {
if (fpsRange[Camera.Parameters.PREVIEW_FPS_MAX_INDEX] >= MIN_FPS * 1000) {
int fpsMax = fpsRange[Camera.Parameters.PREVIEW_FPS_MAX_INDEX];
if (fpsMax >= MIN_FPS * 1000 &&
(minimumSuitableFpsRange == null ||
fpsMax > minimumSuitableFpsRange[Camera.Parameters.PREVIEW_FPS_MAX_INDEX])) {
minimumSuitableFpsRange = fpsRange;
break;
}
}
if (minimumSuitableFpsRange == null) {