Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b242bae authored by Johan Redestig's avatar Johan Redestig Committed by Steve Kondik
Browse files

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
parent 445b7212
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -361,12 +361,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);
    }

    /**