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

Commit 6192631d authored by Shunkai Yao's avatar Shunkai Yao Committed by Automerger Merge Worker
Browse files

Merge "Revert "libeffects: Fix processed samples for downmix effect"" into...

Merge "Revert "libeffects: Fix processed samples for downmix effect"" into main am: 24c5a9f4 am: 030e409c

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



Change-Id: I9ed7e7edbc4b2a563890cc421152105cc1eaf07b
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents efe6216d 030e409c
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -111,12 +111,11 @@ void DownmixContext::reset() {
}

IEffect::Status DownmixContext::downmixProcess(float* in, float* out, int samples) {
    LOG(VERBOSE) << __func__ << " in " << in << " out " << out << " sample " << samples;
    LOG(DEBUG) << __func__ << " in " << in << " out " << out << " sample " << samples;
    IEffect::Status status = {EX_ILLEGAL_ARGUMENT, 0, 0};

    if (in == nullptr || out == nullptr ||
        getCommon().input.frameCount != getCommon().output.frameCount || getInputFrameSize() == 0) {
        LOG(ERROR) << __func__ << " either in/out buffer invalid or framecount mismatch";
        return status;
    }

@@ -129,7 +128,7 @@ IEffect::Status DownmixContext::downmixProcess(float* in, float* out, int sample
        return status;
    }

    LOG(VERBOSE) << __func__ << " start processing";
    LOG(DEBUG) << __func__ << " start processing";
    bool accumulate = false;
    int frames = samples * sizeof(float) / getInputFrameSize();
    if (mType == Downmix::Type::STRIP) {
@@ -154,9 +153,8 @@ IEffect::Status DownmixContext::downmixProcess(float* in, float* out, int sample
            return status;
        }
    }
    int producedSamples = samples * getOutputFrameSize() / getInputFrameSize();
    LOG(VERBOSE) << __func__ << " done processing generated samples " << producedSamples;
    return {STATUS_OK, samples, producedSamples};
    LOG(DEBUG) << __func__ << " done processing";
    return {STATUS_OK, samples, samples};
}

void DownmixContext::init_params(const Parameter::Common& common) {