summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/camera/VideoModule.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index bae16bde6..bbe4c421a 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -80,6 +80,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.HashMap;
import java.lang.reflect.Method;
+import java.util.regex.Pattern;
public class VideoModule implements CameraModule,
VideoController,
@@ -2547,10 +2548,9 @@ public class VideoModule implements CameraModule,
mActivity.getString(R.string.pref_video_time_lapse_frame_interval_default));
int timeLapseInterval = Integer.parseInt(frameIntervalStr);
int rate = 0;
- if (!hfr.equals("off"))
- rate = Integer.parseInt(hfr);
- else
- rate = Integer.parseInt(hsr);
+ if ( isDigit(highFrameRate.substring(3)) ) {
+ rate = Integer.parseInt(highFrameRate.substring(3));
+ }
Log.v(TAG, "rate = "+rate);
if ( (timeLapseInterval != 0) ||
(disMode.equals("enable") && (rate > PERSIST_EIS_MAX_FPS)) ||
@@ -2604,6 +2604,12 @@ public class VideoModule implements CameraModule,
}
}
+ private boolean isDigit(String input) {
+ String ruler = "[1-9][0-9]*";
+ Pattern pattern = Pattern.compile(ruler);
+ return pattern.matcher(input).matches();
+ }
+
@SuppressWarnings("deprecation")
private void setCameraParameters(boolean isFlashDelay) {
Log.d(TAG,"Preview dimension in App->"+mDesiredPreviewWidth+"X"+mDesiredPreviewHeight);