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

Commit e0c3d791 authored by Andy Hung's avatar Andy Hung
Browse files

AudioMixer: Fix expand mono track to multi-channel

Fix commit c5cf9e2c.

Test: Instrumented apk, see bug for apk and details
Bug: 157618660
Change-Id: Ib4eae82db101f9fd895c3d70b2d24446ce26a7bf
parent d40bc761
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1500,7 +1500,7 @@ void AudioMixerBase::TrackBase::track__Resample(TO* out, size_t outFrameCount, T
    ALOGVV("track__Resample\n");
    mResampler->setSampleRate(sampleRate);
    const bool ramp = needsRamp();
    if (MIXTYPE == MIXTYPE_MONOEXPAND || MIXTYPE == MIXTYPE_STEREOEXPAND
    if (MIXTYPE == MIXTYPE_MONOEXPAND || MIXTYPE == MIXTYPE_STEREOEXPAND // custom volume handling
            || ramp || aux != NULL) {
        // if ramp:        resample with unity gain to temp buffer and scale/mix in 2nd step.
        // if aux != NULL: resample with unity gain to temp buffer then apply send level.
+2 −1
Original line number Diff line number Diff line
@@ -236,7 +236,8 @@ void stereoVolumeHelper(TO*& out, const TI*& in, const TV *vol, F f) {
            || MIXTYPE == MIXTYPE_MULTI_SAVEONLY_STEREOVOL
            || MIXTYPE == MIXTYPE_STEREOEXPAND);
    auto proc = [](auto& a, const auto& b) {
        if constexpr (MIXTYPE == MIXTYPE_MULTI_STEREOVOL) {
        if constexpr (MIXTYPE == MIXTYPE_MULTI_STEREOVOL
                || MIXTYPE == MIXTYPE_STEREOEXPAND) {
            a += b;
        } else {
            a = b;