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

Commit c063c175 authored by Eric Laurent's avatar Eric Laurent Committed by Android (Google) Code Review
Browse files

Merge "AudioTrack: fix unwanted underrun when restarting" into klp-dev

parents e07f5372 ec9a032c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -387,6 +387,9 @@ status_t AudioTrack::start()
    if (previousState == STATE_STOPPED || previousState == STATE_FLUSHED) {
        // reset current position as seen by client to 0
        mProxy->setEpoch(mProxy->getEpoch() - mProxy->getPosition());
        // force refresh of remaining frames by processAudioBuffer() as last
        // write before stop could be partial.
        mRefreshRemaining = true;
    }
    mNewPosition = mProxy->getPosition() + mUpdatePeriod;
    int32_t flags = android_atomic_and(~CBLK_DISABLED, &mCblk->mFlags);