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

Commit ac8eabca 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

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

Change-Id: I8cc3e9978d6ea1e2d5099a6b484f2668cdf6a475
parents 58aa0a29 6b605f29
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()