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

Commit 72ff30cf authored by Vineeta Srivastava's avatar Vineeta Srivastava Committed by Android Git Automerger
Browse files

am 57c1f758: am f3a6234b: Merge "Fix kAutoRampDurationUs overflow issue" into klp-dev

* commit '57c1f758':
  Fix kAutoRampDurationUs overflow issue
parents 7ec9fbd9 57c1f758
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -236,10 +236,10 @@ status_t AudioSource::read(
        memset((uint8_t *) buffer->data(), 0, buffer->range_length());
    } else if (elapsedTimeUs < kAutoRampStartUs + kAutoRampDurationUs) {
        int32_t autoRampDurationFrames =
                    (kAutoRampDurationUs * mSampleRate + 500000LL) / 1000000LL;
                    ((int64_t)kAutoRampDurationUs * mSampleRate + 500000LL) / 1000000LL; //Need type casting

        int32_t autoRampStartFrames =
                    (kAutoRampStartUs * mSampleRate + 500000LL) / 1000000LL;
                    ((int64_t)kAutoRampStartUs * mSampleRate + 500000LL) / 1000000LL; //Need type casting

        int32_t nFrames = mNumFramesReceived - autoRampStartFrames;
        rampVolume(nFrames, autoRampDurationFrames,