From 60fd20e6fca17943bc9b2c4854812d2861afbe9a Mon Sep 17 00:00:00 2001 From: Ripinder Singh Date: Wed, 12 Nov 2025 13:28:56 +1100 Subject: [PATCH 1/2] Fix split rendering configuration on decoder restart Signed-off-by: Ripinder Singh --- apps/decoder.c | 28 +++++++++++++++++++++++++++- lib_com/options.h | 1 + 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/apps/decoder.c b/apps/decoder.c index 889fde4798..4c407b4394 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -217,6 +217,9 @@ static ivas_error decodeVoIP( #ifdef FIX_1119_SPLIT_RENDERING_VOIP ISAR_SPLIT_REND_BITS_DATA *splitRendBits, #endif +#ifdef FIX_SPLIT_RENDERING_ON_DECODER_RESTART + IVAS_RENDER_CONFIG_DATA *renderConfig, +#endif #ifdef DECODER_FORMAT_SWITCHING IVAS_DEC_HANDLE *phIvasDec, #else @@ -267,6 +270,9 @@ int main( IVAS_ROOM_ACOUSTICS_CONFIG_DATA **pAE = NULL; uint32_t aeCount = 0; #endif +#ifdef FIX_SPLIT_RENDERING_ON_DECODER_RESTART + IVAS_RENDER_CONFIG_DATA renderConfig = { 0 }; +#endif #ifdef DEBUGGING int32_t noClipping; int32_t cnt_frames_limited; @@ -655,7 +661,9 @@ int main( if ( arg.renderConfigEnabled ) { +#ifndef FIX_SPLIT_RENDERING_ON_DECODER_RESTART IVAS_RENDER_CONFIG_DATA renderConfig; +#endif /* sanity check */ if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && @@ -854,6 +862,9 @@ int main( #ifdef FIX_1119_SPLIT_RENDERING_VOIP &splitRendBits, #endif +#ifdef FIX_SPLIT_RENDERING_ON_DECODER_RESTART + &renderConfig, +#endif #ifdef DECODER_FORMAT_SWITCHING &hIvasDec, #else @@ -3400,6 +3411,9 @@ static ivas_error decodeVoIP( #ifdef FIX_1119_SPLIT_RENDERING_VOIP ISAR_SPLIT_REND_BITS_DATA *splitRendBits, #endif +#ifdef FIX_SPLIT_RENDERING_ON_DECODER_RESTART + IVAS_RENDER_CONFIG_DATA *renderConfig, +#endif #ifdef DECODER_FORMAT_SWITCHING IVAS_DEC_HANDLE *phIvasDec, #else @@ -3643,8 +3657,12 @@ static ivas_error decodeVoIP( &hIvasDec, newCodecInPacket, &arg, +#ifdef FIX_SPLIT_RENDERING_ON_DECODER_RESTART + renderConfig, +#else NULL, /* ToDo : Provide rendererConfig */ - NULL /* ToDo : Provide LS Custom Data */ +#endif + NULL /* ToDo : Provide LS Custom Data */ ); if ( error != IVAS_ERR_OK ) { @@ -4708,6 +4726,7 @@ ivas_error restartDecoder( goto cleanup; } +#ifndef FIX_SPLIT_RENDERING_ON_DECODER_RESTART if ( arg->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { if ( ( error = IVAS_DEC_EnableSplitRendering( hIvasDec ) ) != IVAS_ERR_OK ) @@ -4724,6 +4743,7 @@ ivas_error restartDecoder( arg->enableHeadRotation = true; } +#endif if ( arg->voipMode ) { @@ -4740,6 +4760,12 @@ ivas_error restartDecoder( goto cleanup; } +#ifdef FIX_SPLIT_RENDERING_ON_DECODER_RESTART + /* ISAR frame size is set from command line, not renderer config file. + * This will be ignored if output format is not split rendering. */ + renderConfig->split_rend_config.isar_frame_size_ms = (int16_t) arg->renderFramesize /* given in number of 5ms subframes */ * 5; +#endif + if ( arg->renderConfigEnabled && renderConfig != NULL ) { if ( ( error = IVAS_DEC_FeedRenderConfig( hIvasDec, *renderConfig ) ) != IVAS_ERR_OK ) diff --git a/lib_com/options.h b/lib_com/options.h index 11fd17c3f3..cab8de9c6f 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -167,6 +167,7 @@ #define ISM_PI_DATA /* Add reading and packing/unpacking of ISM PI data */ #define REVERSE_ISM_PI_DATA /* Add reading and packing/unpacking of reverse ISM PI data */ #define DECODER_FORMAT_SWITCHING /* Re-initialize the decoder when the format/subformat of the incoming stream is changed */ +#define FIX_SPLIT_RENDERING_ON_DECODER_RESTART /* Re-configure split rendering on decoder restart */ /* ################### Start BE switches ################################# */ /* only BE switches wrt selection floating point code */ -- GitLab From d1a6d4379c82b440826ae52a547c6ad44dcb7e85 Mon Sep 17 00:00:00 2001 From: Lauros Pajunen Date: Wed, 12 Nov 2025 15:43:43 +0200 Subject: [PATCH 2/2] Add null check --- apps/decoder.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/decoder.c b/apps/decoder.c index 4c407b4394..478f4f2107 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -4763,7 +4763,10 @@ ivas_error restartDecoder( #ifdef FIX_SPLIT_RENDERING_ON_DECODER_RESTART /* ISAR frame size is set from command line, not renderer config file. * This will be ignored if output format is not split rendering. */ - renderConfig->split_rend_config.isar_frame_size_ms = (int16_t) arg->renderFramesize /* given in number of 5ms subframes */ * 5; + if ( renderConfig != NULL ) + { + renderConfig->split_rend_config.isar_frame_size_ms = (int16_t) arg->renderFramesize /* given in number of 5ms subframes */ * 5; + } #endif if ( arg->renderConfigEnabled && renderConfig != NULL ) -- GitLab