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

Commit 08633e60 authored by Andy Hung's avatar Andy Hung Committed by Automerger Merge Worker
Browse files

AudioFlinger: Do not send down 0's on direct PCM track underrun am: 6b605f29 am: ac8eabca

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/1690348

Change-Id: I6b59a304530fa9ea5dd1df3fed83b287b1c6b8d2
parents 6a4076ca ac8eabca
Loading
Loading
Loading
Loading
+6 −9
Original line number Diff line number Diff line
@@ -6043,16 +6043,13 @@ void AudioFlinger::DirectOutputThread::threadLoop_sleepTime()
        mSleepTimeUs = mIdleSleepTimeUs;
        return;
    }
    if (mSleepTimeUs == 0) {
    if (mMixerStatus == MIXER_TRACKS_ENABLED) {
        mSleepTimeUs = mActiveSleepTimeUs;
    } else {
        mSleepTimeUs = mIdleSleepTimeUs;
    }
    } else if (mBytesWritten != 0 && audio_has_proportional_frames(mFormat)) {
        memset(mSinkBuffer, 0, mFrameCount * mFrameSize);
        mSleepTimeUs = 0;
    }
    // Note: In S or later, we do not write zeroes for
    // linear or proportional PCM direct tracks in underrun.
}

void AudioFlinger::DirectOutputThread::threadLoop_exit()