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

Commit 780882de authored by Pawin Vongmasa's avatar Pawin Vongmasa
Browse files

Fix the calculation of the number of frames

Test: make cts -j123 && cts-tradefed run cts-dev -m \
CtsMediaTestCases --compatibility:module-arg \
CtsMediaTestCases:include-annotation:\
android.platform.test.annotations.RequiresDevice

Bug: 64730503
Change-Id: Ie858a52cf7267b3783f67ca378a8c5efb726495c
parent 2c8c51d4
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -733,7 +733,7 @@ bool GraphicBufferSource::calculateCodecTimestamp_l(
        } else {
            // snap to nearest capture point
            int64_t nFrames = std::llround(
                    (timeUs - mPrevCaptureUs) * mCaptureFps);
                    (timeUs - mPrevCaptureUs) * mCaptureFps / 1000000);
            if (nFrames <= 0) {
                // skip this frame as it's too close to previous capture
                ALOGV("skipping frame, timeUs %lld", static_cast<long long>(timeUs));
@@ -741,9 +741,9 @@ bool GraphicBufferSource::calculateCodecTimestamp_l(
            }
            mFrameCount += nFrames;
            mPrevCaptureUs = mBaseCaptureUs + std::llround(
                    mFrameCount / mCaptureFps);
                    mFrameCount * 1000000 / mCaptureFps);
            mPrevFrameUs = mBaseFrameUs + std::llround(
                    mFrameCount / mFps);
                    mFrameCount * 1000000 / mFps);
        }

        ALOGV("timeUs %lld, captureUs %lld, frameUs %lld",