Commit a0ebc815 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

[fix] infinite loop caused by incorrect rendering granularity setting

parent b511c258
Loading
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -249,7 +249,13 @@ ivas_error ivas_spar_dec_open(
            nchan_to_allocate = 2 * BINAURAL_CHANNELS;
        }

        if ( st_ivas->ivas_format == SBA_ISM_FORMAT && ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) && st_ivas->ism_mode == ISM_SBA_MODE_DISC )
        if ( st_ivas->ivas_format == SBA_ISM_FORMAT &&
#ifdef NONBE_FIX_935_SBA_REVERB
             st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL &&
#else
             ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) &&
#endif
             st_ivas->ism_mode == ISM_SBA_MODE_DISC )
        {
            /* get correct granularity in case of binaural rendering of the discrete objects with the td obj renderer */
            granularity = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / ( FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES ) );