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

Commit 2a88d943 authored by Shunkai Yao's avatar Shunkai Yao Committed by Automerger Merge Worker
Browse files

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

Merge "libeffects: Fix processed samples for downmix effect" into main am: ecde86a4 am: c0a141b5 am: 8d7ca7c2

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



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

IEffect::Status DownmixContext::downmixProcess(float* in, float* out, int samples) {
    LOG(DEBUG) << __func__ << " in " << in << " out " << out << " sample " << samples;
    LOG(VERBOSE) << __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;
    }

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

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

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