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

Commit eb6c38a9 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Prevent old callback events when track is recycled"

parents 1e1e06ba 6e8bf981
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -706,6 +706,13 @@ status_t AudioTrack::start()
        // force refresh of remaining frames by processAudioBuffer() as last
        // write before stop could be partial.
        mRefreshRemaining = true;

        // for static track, clear the old flags when starting from stopped state
        if (mSharedBuffer != 0) {
            android_atomic_and(
            ~(CBLK_LOOP_CYCLE | CBLK_LOOP_FINAL | CBLK_BUFFER_END),
            &mCblk->mFlags);
        }
    }
    mNewPosition = mPosition + mUpdatePeriod;
    int32_t flags = android_atomic_and(~(CBLK_STREAM_END_DONE | CBLK_DISABLED), &mCblk->mFlags);