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

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

am a54d7d3d: Fixed underrun in audioflinger mixer.

Merge commit 'a54d7d3d' into gingerbread-plus-aosp

* commit 'a54d7d3d':
  Fixed underrun in audioflinger mixer.
parents 45dc4f82 a54d7d3d
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;
    }