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

Commit 48e8f0c1 authored by Jiabin Huang's avatar Jiabin Huang
Browse files

Audioflinger: adjust wait time for duplicating thread

When the downstream thread has a larger frame count than duplicating thread, lower the wait time to avoid underrun on the downstream thread.

Bug: 361029363
Change-Id: I1a9b64e363748ab9d1c0b16ebaef2f0022e1d3ec
Test: TH
Flag: EXEMPT bugfix
parent 4d0c9e86
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -7881,7 +7881,8 @@ void DuplicatingThread::removeOutputTrack(IAfPlaybackThread* thread)
// caller must hold mutex()
void DuplicatingThread::updateWaitTime_l()
{
    mWaitTimeMs = UINT_MAX;
    // Initialize mWaitTimeMs according to the mixer buffer size.
    mWaitTimeMs = mNormalFrameCount * 2 * 1000 / mSampleRate;
    for (size_t i = 0; i < mOutputTracks.size(); i++) {
        const auto strong = mOutputTracks[i]->thread().promote();
        if (strong != 0) {