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

Commit aeea6fa4 authored by Wonsik Kim's avatar Wonsik Kim Committed by android-build-merger
Browse files

Merge "codec2: fix rare native crash in buffer queue thread" into qt-dev am: d0fb5dc7

am: 05d3c236

Change-Id: Ia8b91fdbdc636ba80ecdc0f928b5f78b9434d75a
parents 60315248 05d3c236
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -76,10 +76,11 @@ protected:
            Mutexed<Jobs>::Locked jobs(mJobs);
            Mutexed<Jobs>::Locked jobs(mJobs);
            nsecs_t nowNs = systemTime();
            nsecs_t nowNs = systemTime();
            bool queued = false;
            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;
                Queue &queue = it->second;
                if (queue.workList.empty()
                if (queue.workList.empty()
                        || nowNs - queue.lastQueuedTimestampNs < kIntervalNs) {
                        || nowNs - queue.lastQueuedTimestampNs < kIntervalNs) {
                    ++it;
                    continue;
                    continue;
                }
                }
                std::shared_ptr<Codec2Client::Component> comp = queue.component.lock();
                std::shared_ptr<Codec2Client::Component> comp = queue.component.lock();
@@ -109,6 +110,7 @@ protected:
                }
                }
                jobs.lock();
                jobs.lock();


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