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

Commit efd58e5f authored by Eric Laurent's avatar Eric Laurent Committed by Android Git Automerger
Browse files

am ba676a00: am a54d7d3d: Fixed underrun in audioflinger mixer.

Merge commit 'ba676a00'

* commit 'ba676a00':
  Fixed underrun in audioflinger mixer.
parents e199f1dd ba676a00
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2015,7 +2015,7 @@ uint32_t AudioFlinger::MixerThread::activeSleepTimeUs()

uint32_t AudioFlinger::MixerThread::idleSleepTimeUs()
{
    return (uint32_t)((mFrameCount * 1000) / mSampleRate) * 1000;
    return (uint32_t)(((mFrameCount * 1000) / mSampleRate) * 1000) / 2;
}

// ----------------------------------------------------------------------------
@@ -2476,7 +2476,7 @@ uint32_t AudioFlinger::DirectOutputThread::idleSleepTimeUs()
{
    uint32_t time;
    if (AudioSystem::isLinearPCM(mFormat)) {
        time = (uint32_t)((mFrameCount * 1000) / mSampleRate) * 1000;
        time = (uint32_t)(((mFrameCount * 1000) / mSampleRate) * 1000) / 2;
    } else {
        time = 10000;
    }