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

Commit 31782d7c authored by Andy Hung's avatar Andy Hung Committed by Gerrit Code Review
Browse files

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

parents 6cd0481a 511599f5
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.