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

Commit 6d88aaf9 authored by Glenn Kasten's avatar Glenn Kasten Committed by Android (Google) Code Review
Browse files

Merge "AudioRecord: fix unwanted overrun when restarting"

parents 6a507298 5e1f79ba
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -289,6 +289,9 @@ status_t AudioRecord::start(AudioSystem::sync_event_t event, int triggerSession)

    // reset current position as seen by client to 0
    mProxy->setEpoch(mProxy->getEpoch() - mProxy->getPosition());
    // force refresh of remaining frames by processAudioBuffer() as last
    // read before stop could be partial.
    mRefreshRemaining = true;

    mNewPosition = mProxy->getPosition() + mUpdatePeriod;
    int32_t flags = android_atomic_acquire_load(&mCblk->mFlags);