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

Commit 9a8cc9ea authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "libmedia: correct latency computing of AudioRecord"

parents 26c4c3be 37e52900
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -272,7 +272,12 @@ status_t AudioRecord::set(
    mStatus = NO_ERROR;
    mUserData = user;
    // TODO: add audio hardware input latency here
    mLatency = (1000 * mFrameCount) / mSampleRate;
    if (mTransfer == TRANSFER_CALLBACK ||
            mTransfer == TRANSFER_SYNC) {
        mLatency = (1000 * mNotificationFramesAct) / sampleRate;
    } else {
        mLatency = (1000 * mFrameCount) / sampleRate;
    }
    mMarkerPosition = 0;
    mMarkerReached = false;
    mNewPosition = 0;