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

Commit 5d4197d6 authored by Paras Nagda's avatar Paras Nagda Committed by Gerrit - the friendly Code Review server
Browse files

MediaRecorder: Handle 24-hour timelapse duration

Use float operations to derive the max-time-between-
frames from capture-rate.
With default (double) precision, calculated value
exceeds 86,400 seconds (1 day) limit if app configures
captureRate = 1 / 24 hours.

Change-Id: Ia171cfa6a45ad315beb55340651abb8066566b26
parent 9d374d5b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -588,7 +588,7 @@ status_t StagefrightRecorder::setParamCaptureFpsEnable(int32_t captureFpsEnable)
status_t StagefrightRecorder::setParamCaptureFps(float fps) {
    ALOGV("setParamCaptureFps: %.2f", fps);

    int64_t timeUs = (int64_t) (1000000.0 / fps + 0.5f);
    int64_t timeUs = (int64_t) (1000000.0f / fps + 0.5f);

    // Not allowing time more than a day
    if (timeUs <= 0 || timeUs > 86400*1E6) {