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

Commit 205d1715 authored by Vlad Popa's avatar Vlad Popa Committed by Android (Google) Code Review
Browse files

Merge "Fix possible deadlock between effect and af lock"

parents 0e7a2e3c fce10864
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -4080,11 +4080,6 @@ bool AudioFlinger::PlaybackThread::threadLoop()
            setHalLatencyMode_l();
        } // mLock scope ends

        if (!metadataUpdate.playbackMetadataUpdate.empty()) {
            mAudioFlinger->mMelReporter->updateMetadataForCsd(id(),
                    metadataUpdate.playbackMetadataUpdate);
        }

        if (mBytesRemaining == 0) {
            mCurrentWriteLength = 0;
            if (mMixerStatus == MIXER_TRACKS_READY) {
@@ -4275,6 +4270,11 @@ bool AudioFlinger::PlaybackThread::threadLoop()
        // enable changes in effect chain
        unlockEffectChains(effectChains);

        if (!metadataUpdate.playbackMetadataUpdate.empty()) {
            mAudioFlinger->mMelReporter->updateMetadataForCsd(id(),
                    metadataUpdate.playbackMetadataUpdate);
        }

        if (!waitingAsyncCallback()) {
            // mSleepTimeUs == 0 means we must write to audio hardware
            if (mSleepTimeUs == 0) {