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

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

am e506084e: am ab9071b8: audioflinger: fix active sleep time calculation.

* commit 'e506084e':
  audioflinger: fix active sleep time calculation.
parents 24a2fd01 e506084e
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -2114,14 +2114,7 @@ audio_stream_t* AudioFlinger::PlaybackThread::stream() const

uint32_t AudioFlinger::PlaybackThread::activeSleepTimeUs() const
{
    // A2DP output latency is not due only to buffering capacity. It also reflects encoding,
    // decoding and transfer time. So sleeping for half of the latency would likely cause
    // underruns
    if (audio_is_a2dp_device((audio_devices_t)mDevice)) {
    return (uint32_t)((uint32_t)((mNormalFrameCount * 1000) / mSampleRate) * 1000);
    } else {
        return (uint32_t)(mOutput->stream->get_latency(mOutput->stream) * 1000) / 2;
    }
}

status_t AudioFlinger::PlaybackThread::setSyncEvent(const sp<SyncEvent>& event)