Skip to content

Commit 1c7928e

Browse files
committed
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
1 parent 13ab2c9 commit 1c7928e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

media/java/android/media/MediaRecorder.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,12 +351,11 @@ public void setProfile(CamcorderProfile profile) {
351351
*/
352352
public void setCaptureRate(double fps) {
353353
// Make sure that time lapse is enabled when this method is called.
354-
setParameter(String.format("time-lapse-enable=1"));
354+
setParameter("time-lapse-enable=1");
355355

356356
double timeBetweenFrameCapture = 1 / fps;
357357
int timeBetweenFrameCaptureMs = (int) (1000 * timeBetweenFrameCapture);
358-
setParameter(String.format("time-between-time-lapse-frame-capture=%d",
359-
timeBetweenFrameCaptureMs));
358+
setParameter("time-between-time-lapse-frame-capture=" + timeBetweenFrameCaptureMs);
360359
}
361360

362361
/**

0 commit comments

Comments
 (0)