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

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

Merge "Attribute throttle time to previous loops write time" into nyc-mr1-dev

parents b343e044 0a31dddf
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -3326,6 +3326,9 @@ bool AudioFlinger::PlaybackThread::threadLoop()
                                    " ret(%zd) deltaMs(%d) requires sleep %d ms",
                                    " ret(%zd) deltaMs(%d) requires sleep %d ms",
                                    this, ret, deltaMs, throttleMs);
                                    this, ret, deltaMs, throttleMs);
                            mThreadThrottleTimeMs += throttleMs;
                            mThreadThrottleTimeMs += throttleMs;
                            // Throttle must be attributed to the previous mixer loop's write time
                            // to allow back-to-back throttling.
                            lastWriteFinished += throttleMs * 1000000;
                        } else {
                        } else {
                            uint32_t diff = mThreadThrottleTimeMs - mThreadThrottleEndMs;
                            uint32_t diff = mThreadThrottleTimeMs - mThreadThrottleEndMs;
                            if (diff > 0) {
                            if (diff > 0) {