From 9ff058c3fc18159ad55b5f3e1c72b4004fa5d905 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 21 May 2025 10:00:41 +0200 Subject: [PATCH] [fix] MASA number of output channels not set correctly for Custom LS output --- lib_com/options.h | 1 + lib_rend/lib_rend.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 3783d86426..c8a7c40e4b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -171,6 +171,7 @@ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ +#define NONBE_FIX_1326_MASA_EXTREND_CUSTOMLS_OUT /* FhG: Fix crash for external renderer MASA to custom LS rendering, number of output channels not set correctly */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 2d77b66ed6..98b3177a15 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -8503,7 +8503,14 @@ static ivas_error initMasaExtRenderer( return error; } - if ( ( error = getAudioConfigNumChannels( outConfig, &hMasaExtRend->nchan_output ) ) != IVAS_ERR_OK ) +#ifdef NONBE_FIX_1326_MASA_EXTREND_CUSTOMLS_OUT + if ( outConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) + { + hMasaExtRend->nchan_output = inputMasa->base.ctx.pCustomLsOut->num_spk + inputMasa->base.ctx.pCustomLsOut->num_lfe; + } + else +#endif + if ( ( error = getAudioConfigNumChannels( outConfig, &hMasaExtRend->nchan_output ) ) != IVAS_ERR_OK ) { return error; } -- GitLab