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

Commit 1e5ca7e7 authored by Andy Hung's avatar Andy Hung Committed by Automerger Merge Worker
Browse files

Merge "Fix for trying to restore audio track after obtain buffer error" into main am: 1eee8744

parents 0b13345a 1eee8744
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -2209,11 +2209,10 @@ status_t AudioTrack::obtainBuffer(Buffer* audioBuffer, const struct timespec *re
        {   // start of lock scope
            AutoMutex lock(mLock);

            uint32_t newSequence = mSequence;
            // did previous obtainBuffer() fail due to media server death or voluntary invalidation?
            if (status == DEAD_OBJECT) {
                // re-create track, unless someone else has already done so
                if (newSequence == oldSequence) {
                if (mSequence == oldSequence) {
                    status = restoreTrack_l("obtainBuffer");
                    if (status != NO_ERROR) {
                        buffer.mFrameCount = 0;
@@ -2223,7 +2222,7 @@ status_t AudioTrack::obtainBuffer(Buffer* audioBuffer, const struct timespec *re
                    }
                }
            }
            oldSequence = newSequence;
            oldSequence = mSequence;

            if (status == NOT_ENOUGH_DATA) {
                restartIfDisabled();