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

Commit 0ca30c33 authored by Wonsik Kim's avatar Wonsik Kim
Browse files

codec2: fix rare native crash in buffer queue thread

Bug: 131800183
Test: atest CtsMediaTestCases -- --module-arg CtsMediaTestCases:size:small
Change-Id: I46a90751ff45577897bdcffbe912db12993a7467
parent eacca061
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -76,10 +76,11 @@ protected:
            Mutexed<Jobs>::Locked jobs(mJobs);
            nsecs_t nowNs = systemTime();
            bool queued = false;
            for (auto it = jobs->queues.begin(); it != jobs->queues.end(); ++it) {
            for (auto it = jobs->queues.begin(); it != jobs->queues.end(); ) {
                Queue &queue = it->second;
                if (queue.workList.empty()
                        || nowNs - queue.lastQueuedTimestampNs < kIntervalNs) {
                    ++it;
                    continue;
                }
                std::shared_ptr<Codec2Client::Component> comp = queue.component.lock();
@@ -109,6 +110,7 @@ protected:
                }
                jobs.lock();

                it = jobs->queues.upper_bound(comp);
                queued = true;
            }
            if (queued) {