video: initialize fps range using first value given by the hardware

This commit is contained in:
Pierre-Eric Pelloux-Prayer 2011-08-12 09:37:22 +02:00
parent 7bd4a7f7ef
commit e37088be43

View file

@ -58,7 +58,7 @@ public abstract class AndroidCameraRecord implements AutoFocusCallback {
private int[] findClosestFpsRange(int expectedFps, List<int[]> fpsRanges) { private int[] findClosestFpsRange(int expectedFps, List<int[]> fpsRanges) {
Log.d("Searching for closest fps range from ",expectedFps); Log.d("Searching for closest fps range from ",expectedFps);
int measure = Integer.MAX_VALUE; int measure = Integer.MAX_VALUE;
int[] closestRange = {expectedFps,expectedFps}; int[] closestRange = fpsRanges.get(0);
for (int[] curRange : fpsRanges) { for (int[] curRange : fpsRanges) {
if (curRange[0] > expectedFps || curRange[1] < expectedFps) continue; if (curRange[0] > expectedFps || curRange[1] < expectedFps) continue;
int curMeasure = Math.abs(curRange[0] - expectedFps) int curMeasure = Math.abs(curRange[0] - expectedFps)