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

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

Merge "Audio Effect : Add checks to validate the channel count" into main am:...

Merge "Audio Effect : Add checks to validate the channel count" into main am: a10d3c53 am: 7f56477a am: cb2e3896

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2902252



Change-Id: I18ec37e502764ea63b7a04fb65f8af69f0b1ac44
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents b7a9eaef cb2e3896
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -46,6 +46,14 @@ class EffectContext {
        LOG_ALWAYS_FATAL_IF(output.base.format.pcm !=
        LOG_ALWAYS_FATAL_IF(output.base.format.pcm !=
                                    aidl::android::media::audio::common::PcmType::FLOAT_32_BIT,
                                    aidl::android::media::audio::common::PcmType::FLOAT_32_BIT,
                            "outputFormatNotFloat");
                            "outputFormatNotFloat");

        size_t inputChannelCount =
                ::aidl::android::hardware::audio::common::getChannelCount(input.base.channelMask);
        LOG_ALWAYS_FATAL_IF(inputChannelCount == 0, "inputChannelCountNotValid");
        size_t outputChannelCount =
                ::aidl::android::hardware::audio::common::getChannelCount(output.base.channelMask);
        LOG_ALWAYS_FATAL_IF(outputChannelCount == 0, "outputChannelCountNotValid");

        mInputFrameSize = ::aidl::android::hardware::audio::common::getFrameSizeInBytes(
        mInputFrameSize = ::aidl::android::hardware::audio::common::getFrameSizeInBytes(
                input.base.format, input.base.channelMask);
                input.base.format, input.base.channelMask);
        mOutputFrameSize = ::aidl::android::hardware::audio::common::getFrameSizeInBytes(
        mOutputFrameSize = ::aidl::android::hardware::audio::common::getFrameSizeInBytes(