From 36740e010029da084640250d09e352f829665585 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Mon, 16 Mar 2026 14:43:04 -0700 Subject: [PATCH] spa: aec: Add some channel config validation This is checked in AudioProcessing, but will fail at processing time rather than in initialisation. --- spa/plugins/aec/aec-webrtc.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spa/plugins/aec/aec-webrtc.cpp b/spa/plugins/aec/aec-webrtc.cpp index 08697288b..2e451d851 100644 --- a/spa/plugins/aec/aec-webrtc.cpp +++ b/spa/plugins/aec/aec-webrtc.cpp @@ -221,6 +221,11 @@ static int webrtc_init2(void *object, const struct spa_dict *args, }}; #endif + if (out_info->channels != 1 && rec_info->channels != out_info->channels) { + spa_log_error(impl->log, "Source channels must be equal to capture channels or 1"); + return -EINVAL; + } + #if defined(HAVE_WEBRTC) auto apm = std::unique_ptr(webrtc::AudioProcessing::Create(config)); #elif defined(HAVE_WEBRTC1)