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

Commit 7c7edfae authored by Andy Hung's avatar Andy Hung Committed by Android (Google) Code Review
Browse files

Merge "AudioFlinger: Fix FastMixer balance initialization" into main

parents 87a63c5b 922617c5
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -5093,7 +5093,6 @@ MixerThread::MixerThread(const sp<IAfThreadCallback>& afThreadCallback, AudioStr
        // mPipeSink below
        // mNormalSink below
{
    setMasterBalance(afThreadCallback->getMasterBalance_l());
    ALOGV("MixerThread() id=%d type=%d", id, type);
    ALOGV("mSampleRate=%u, mChannelMask=%#x, mChannelCount=%u, mFormat=%#x, mFrameSize=%zu, "
            "mFrameCount=%zu, mNormalFrameCount=%zu",
@@ -5105,6 +5104,8 @@ MixerThread::MixerThread(const sp<IAfThreadCallback>& afThreadCallback, AudioStr
        // The Duplicating thread uses the AudioMixer and delivers data to OutputTracks
        // (downstream MixerThreads) in DuplicatingThread::threadLoop_write().
        // Do not create or use mFastMixer, mOutputSink, mPipeSink, or mNormalSink.
        // Balance is *not* set in the DuplicatingThread here (or from AudioFlinger),
        // as the downstream MixerThreads implement it.
        return;
    }
    // create an NBAIO sink for the HAL output stream, and negotiate
@@ -5264,6 +5265,9 @@ MixerThread::MixerThread(const sp<IAfThreadCallback>& afThreadCallback, AudioStr
        mNormalSink = initFastMixer ? mPipeSink : mOutputSink;
        break;
    }
    // setMasterBalance needs to be called after the FastMixer
    // (if any) is set up, in order to deliver the balance settings to it.
    setMasterBalance(afThreadCallback->getMasterBalance_l());
}

MixerThread::~MixerThread()