spa: aec: Add some channel config validation

This is checked in AudioProcessing, but will fail at processing time
rather than in initialisation.
This commit is contained in:
Arun Raghavan 2026-03-16 14:43:04 -07:00 committed by Wim Taymans
parent edb074f438
commit 36740e0100

View file

@ -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>(webrtc::AudioProcessing::Create(config));
#elif defined(HAVE_WEBRTC1)