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

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

Merge "Fix deadlock" into lmp-preview-dev

parents 3bcffa13 3d61bc1f
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -5137,7 +5137,7 @@ reacquire_wakelock:
            sleepUs = kRecordThreadSleepUs;
        }
        if (framesRead <= 0) {
            continue;
            goto unlock;
        }
        ALOG_ASSERT(framesRead > 0);

@@ -5145,11 +5145,13 @@ reacquire_wakelock:
            (void) mTeeSink->write(&mRsmpInBuffer[rear * mChannelCount], framesRead);
        }
        // If destination is non-contiguous, we now correct for reading past end of buffer.
        {
            size_t part1 = mRsmpInFramesP2 - rear;
            if ((size_t) framesRead > part1) {
                memcpy(mRsmpInBuffer, &mRsmpInBuffer[mRsmpInFramesP2 * mChannelCount],
                        (framesRead - part1) * mFrameSize);
            }
        }
        rear = mRsmpInRear += framesRead;

        size = activeTracks.size();
@@ -5356,6 +5358,7 @@ reacquire_wakelock:

        }

unlock:
        // enable changes in effect chain
        unlockEffectChains(effectChains);
        // effectChains doesn't need to be cleared, since it is cleared by destructor at scope end