Merge \"Attribute throttle time to previous loops write time\" into nyc-mr1-dev
am: bf6dc1af5b

Change-Id: I4bc857144d49760097f7344c1d58ad7444b66548
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index eb3aad9..a5b2e26 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -3326,6 +3326,9 @@
                                     " ret(%zd) deltaMs(%d) requires sleep %d ms",
                                     this, ret, deltaMs, 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 {
                             uint32_t diff = mThreadThrottleTimeMs - mThreadThrottleEndMs;
                             if (diff > 0) {