From 1c7928e8c68654d087f83c7cefc59095950b8bef Mon Sep 17 00:00:00 2001 From: Johan Redestig Date: Mon, 27 Aug 2012 10:31:25 +0200 Subject: Make setCaptureRate locale safe Dont use the default String.format in setCaptureRate as it is both locale unsafe and less efficient than regular string concatenation in this case. Change-Id: I29418ec0352ef8c79967592b6eb8ff66cc9c99f0 --- media/java/android/media/MediaRecorder.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'media') diff --git a/media/java/android/media/MediaRecorder.java b/media/java/android/media/MediaRecorder.java index 9af201d..613354f 100644 --- a/media/java/android/media/MediaRecorder.java +++ b/media/java/android/media/MediaRecorder.java @@ -351,12 +351,11 @@ public class MediaRecorder */ public void setCaptureRate(double fps) { // Make sure that time lapse is enabled when this method is called. - setParameter(String.format("time-lapse-enable=1")); + setParameter("time-lapse-enable=1"); double timeBetweenFrameCapture = 1 / fps; int timeBetweenFrameCaptureMs = (int) (1000 * timeBetweenFrameCapture); - setParameter(String.format("time-between-time-lapse-frame-capture=%d", - timeBetweenFrameCaptureMs)); + setParameter("time-between-time-lapse-frame-capture=" + timeBetweenFrameCaptureMs); } /** -- cgit v1.1