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

Commit fe6ab50b authored by Andy Hung's avatar Andy Hung Committed by Android (Google) Code Review
Browse files

Merge "DuplicatingThread: Release tracks in threadLoop" into main

parents c0d8f376 8a5abfd6
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -7608,6 +7608,23 @@ void DuplicatingThread::threadLoop_standby()
    }
}

void DuplicatingThread::threadLoop_exit()
{
    // Prevent calling the OutputTrack dtor in the DuplicatingThread dtor
    // where other mutexes (i.e. AudioPolicyService_Mutex) may be held.
    // Do so here in the threadLoop_exit().

    SortedVector <sp<IAfOutputTrack>> localTracks;
    {
        audio_utils::lock_guard l(mutex());
        localTracks = std::move(mOutputTracks);
        mOutputTracks.clear();
    }
    localTracks.clear();
    outputTracks.clear();
    PlaybackThread::threadLoop_exit();
}

void DuplicatingThread::dumpInternals_l(int fd, const Vector<String16>& args)
{
    MixerThread::dumpInternals_l(fd, args);
+1 −0
Original line number Diff line number Diff line
@@ -1849,6 +1849,7 @@ protected:
    void threadLoop_sleepTime() final REQUIRES(ThreadBase_ThreadLoop);
    ssize_t threadLoop_write() final REQUIRES(ThreadBase_ThreadLoop);
    void threadLoop_standby() final REQUIRES(ThreadBase_ThreadLoop);
    void threadLoop_exit() final REQUIRES(ThreadBase_ThreadLoop);
    void cacheParameters_l() final REQUIRES(mutex(), ThreadBase_ThreadLoop);

private: