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

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

Merge "libmediaplayerservice: Explicitly force callbacks to stop running" into main am: 31782d7c

parents d286b489 31782d7c
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -2514,6 +2514,15 @@ void MediaPlayerService::AudioOutput::close()
    {
        Mutex::Autolock lock(mLock);
        track = mTrack;
    }

    // do not hold lock while joining.
    if (track) {
        track->stopAndJoinCallbacks();
    }

    {
        Mutex::Autolock lock(mLock);
        close_l(); // clears mTrack
    }
    // destruction of the track occurs outside of mutex.