Loading
audioflinger: fix active sleep time calculation.
When an audioTrack underruns, the audioflinger mixer thread sleeps for a certain time to give the app a chance to recover. This time is based on the reported audio HAL latency. Some audio HALs implementing deep buffering have a variable latency and this creates a problem if the sleep time is cached when the output stream is opened and not updated afterwards. This change derives the active sleep time from the mix buffer framecount instead of the latency. This is more conservative but works for variable latency. Bug 6588525. Change-Id: Ia892fc290fe06f836565c3ae15f7a2ce026c88c6