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

Commit 50d49afd authored by Jiabin Huang's avatar Jiabin Huang Committed by Automerger Merge Worker
Browse files

Merge "Hold thread lock before calling updateSecondaryOutputsForTrack_l." into...

Merge "Hold thread lock before calling updateSecondaryOutputsForTrack_l." into udc-dev am: 6e5663fe

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/av/+/22894303



Change-Id: I2c7c66628a1c7ed53cc62e177728a9fd584f4067
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 00b85678 6e5663fe
Loading
Loading
Loading
Loading
+10 −11
Original line number Diff line number Diff line
@@ -1236,23 +1236,22 @@ status_t AudioFlinger::createTrack(const media::CreateTrackRequest& _input,
        output.portId = portId;

        if (lStatus == NO_ERROR) {
            // no risk of deadlock because AudioFlinger::mLock is held
            Mutex::Autolock _dl(thread->mLock);
            // Connect secondary outputs. Failure on a secondary output must not imped the primary
            // Any secondary output setup failure will lead to a desync between the AP and AF until
            // the track is destroyed.
            updateSecondaryOutputsForTrack_l(track.get(), thread, secondaryOutputs);
        }

            // move effect chain to this output thread if an effect on same session was waiting
            // for a track to be created
        if (lStatus == NO_ERROR && effectThread != NULL) {
            // no risk of deadlock because AudioFlinger::mLock is held
            Mutex::Autolock _dl(thread->mLock);
            if (effectThread != nullptr) {
                Mutex::Autolock _sl(effectThread->mLock);
                if (moveEffectChain_l(sessionId, effectThread, thread) == NO_ERROR) {
                    effectThreadId = thread->id();
                    effectIds = thread->getEffectIds_l(sessionId);
                }
            }
        }

        // Look for sync events awaiting for a session to be used.
        for (size_t i = 0; i < mPendingSyncEvents.size(); i++) {