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

Commit e9b0fe49 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "DownmixProcess: Add a check to verify that input and output frame...

Merge "DownmixProcess: Add a check to verify that input and output frame counts are same." into main am: 436c0600

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



Change-Id: Idc23af43c16d7763c28d52ca2f33ac7e8dd5e73b
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 38ce0a22 436c0600
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -66,8 +66,8 @@ IEffect::Status DownmixContext::lvmProcess(float* in, float* out, int samples) {
    LOG(DEBUG) << __func__ << " in " << in << " out " << out << " sample " << samples;
    IEffect::Status status = {EX_ILLEGAL_ARGUMENT, 0, 0};

    if (in == nullptr || out == nullptr || getInputFrameSize() != getOutputFrameSize() ||
        getInputFrameSize() == 0) {
    if (in == nullptr || out == nullptr ||
        getCommon().input.frameCount != getCommon().output.frameCount || getInputFrameSize() == 0) {
        return status;
    }

@@ -112,7 +112,7 @@ IEffect::Status DownmixContext::lvmProcess(float* in, float* out, int samples) {
void DownmixContext::init_params(const Parameter::Common& common) {
    // when configuring the effect, do not allow a blank or unsupported channel mask
    AudioChannelLayout channelMask = common.input.base.channelMask;
    if (isChannelMaskValid(channelMask)) {
    if (!isChannelMaskValid(channelMask)) {
        LOG(ERROR) << "Downmix_Configure error: input channel mask " << channelMask.toString()
                   << " not supported";
    } else {
@@ -123,7 +123,7 @@ void DownmixContext::init_params(const Parameter::Common& common) {
}

bool DownmixContext::isChannelMaskValid(AudioChannelLayout channelMask) {
    if (channelMask.getTag() == AudioChannelLayout::layoutMask) return false;
    if (channelMask.getTag() != AudioChannelLayout::layoutMask) return false;
    int chMask = channelMask.get<AudioChannelLayout::layoutMask>();
    // check against unsupported channels (up to FCC_26)
    constexpr uint32_t MAXIMUM_CHANNEL_MASK = AudioChannelLayout::LAYOUT_22POINT2 |