From 4ab59282faa065970e143a2dcd7cffa43e1ff739 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 10 Jun 2025 15:34:50 +0200 Subject: [PATCH] [fix] crash for external split-pre rendering to OMASA --- lib_com/options.h | 1 + lib_rend/lib_rend.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index aec5a9e672..a7e04bfefd 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -179,6 +179,7 @@ #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 */ #define NONBE_1325_TD_STEREO_QUANT_LSF_SEC /* Nokia: issue 1325: fix for usage of active_cnt variable in TD stereo LSFQ */ #define NONBE_FIX_1172_OBJ_EDIT_JBM /* VA: issue 1172: fix OMASA object editing in JBM */ +#define NONBE_FIX_1334_EXTREND_OMASA /* FhG: issue 1334: fix crash for external split-pre rendering to OMASA */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 98b3177a15..4dac37d906 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -3368,6 +3368,16 @@ static int16_t getCldfbRendFlag( numMcInputs += ( hIvasRend->inputsMc[i].base.inConfig == IVAS_AUDIO_CONFIG_INVALID && new_configType != IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) ? 0 : 1; } +#ifdef NONBE_FIX_1334_EXTREND_OMASA + if ( ( numMasaInputs > 0 ) || ( numSbaInputs > 0 && hIvasRend->hRendererConfig->split_rend_config.rendererSelection == IVAS_BIN_RENDERER_TYPE_FASTCONV ) ) + { + isCldfbRend = 1; + } + else if ( numIsmInputs > 0 || numMcInputs > 0 ) + { + isCldfbRend = 0; + } +#else if ( numIsmInputs > 0 || numMcInputs > 0 ) { isCldfbRend = 0; @@ -3376,6 +3386,7 @@ static int16_t getCldfbRendFlag( { isCldfbRend = 1; } +#endif } return isCldfbRend; @@ -5629,11 +5640,20 @@ static ivas_error renderInputIsm( { ivas_error error; IVAS_REND_AudioBuffer inAudio; +#ifdef NONBE_FIX_1334_EXTREND_OMASA + int16_t cldfb2tdSampleFact; +#endif error = IVAS_ERR_OK; inAudio = ismInput->base.inputBuffer; +#ifdef NONBE_FIX_1334_EXTREND_OMASA + cldfb2tdSampleFact = outAudio.config.is_cldfb ? 2 : 1; + if ( ( ismInput->base.numNewSamplesPerChannel * cldfb2tdSampleFact != outAudio.config.numSamplesPerChannel ) && + ( outConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) && ( outConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) +#else if ( ismInput->base.numNewSamplesPerChannel != outAudio.config.numSamplesPerChannel ) +#endif { return IVAS_ERROR( IVAS_ERR_INVALID_BUFFER_SIZE, "Mismatch between the number of input samples vs number of requested output samples - currently not allowed" ); } -- GitLab