mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Merge "Audio Effect : Add checks to validate the channel count" into main am: a10d3c536f
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2902252 Change-Id: Id28f194bbcad3534a27429bea35b894c4b2abc32 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -46,6 +46,14 @@ class EffectContext {
|
||||
LOG_ALWAYS_FATAL_IF(output.base.format.pcm !=
|
||||
aidl::android::media::audio::common::PcmType::FLOAT_32_BIT,
|
||||
"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(
|
||||
input.base.format, input.base.channelMask);
|
||||
mOutputFrameSize = ::aidl::android::hardware::audio::common::getFrameSizeInBytes(
|
||||
|
||||
Reference in New Issue
Block a user