Commit 7452fa00 authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

fix crash with bitrate switching to HO-DirAC modes

parent e0626de9
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -315,11 +315,16 @@ ivas_error ivas_dirac_dec_config(
#endif

    /* band config needed only for SPAR with FOA output */
    if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_FOA && st_ivas->sba_mode == SBA_MODE_SPAR )
    if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_FOA && st_ivas->sba_mode == SBA_MODE_SPAR 
#ifdef HODIRAC
		&& ivas_total_brate < IVAS_256k
#endif
		)
    {
        return IVAS_ERR_OK;
    }


    if ( nchan_transport_orig > 2 && hDirAC->hOutSetup.is_loudspeaker_setup && st_ivas->renderer_type == RENDERER_DIRAC )
    {
        hDirAC->synthesisConf = DIRAC_SYNTHESIS_PSD_LS;
+10 −5
Original line number Diff line number Diff line
@@ -189,8 +189,7 @@ ivas_error ivas_sba_dec_reconfigure(

            if ( nchan_transport_old != ivas_get_sba_num_TCs( ivas_total_brate, sba_order_internal )
#ifdef HODIRAC
				|| ( last_ivas_total_brate >= IVAS_512k && ivas_total_brate < IVAS_512k ) 
				|| ( last_ivas_total_brate < IVAS_512k && ivas_total_brate >= IVAS_512k )
                 || ( last_ivas_total_brate >= IVAS_512k && ivas_total_brate < IVAS_512k ) || ( last_ivas_total_brate < IVAS_512k && ivas_total_brate >= IVAS_512k )
#endif
            )
            {
@@ -284,7 +283,13 @@ ivas_error ivas_sba_dec_reconfigure(
#ifndef LBR_SBA_BR_SWITCHING
    if ( ( ( st_ivas->renderer_type != RENDERER_DISABLE ) && ( st_ivas->renderer_type != RENDERER_SBA_LINEAR_DEC ) ) || ( sba_mode_old != st_ivas->sba_mode ) || ( ( st_ivas->sba_mode == SBA_MODE_SPAR ) && ( ( hDecoderConfig->output_config != AUDIO_CONFIG_FOA ) && ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_STEREO ) && ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_MONO ) ) ) )
#else
    if ( ( ( st_ivas->renderer_type != RENDERER_DISABLE ) && ( st_ivas->renderer_type != RENDERER_SBA_LINEAR_DEC ) ) || ( ( hDecoderConfig->output_config != AUDIO_CONFIG_FOA ) && ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_STEREO ) && ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_MONO ) ) )
    if ( ( ( st_ivas->renderer_type != RENDERER_DISABLE ) && ( st_ivas->renderer_type != RENDERER_SBA_LINEAR_DEC ) ) 
		|| ( ( hDecoderConfig->output_config != AUDIO_CONFIG_FOA ) && ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_STEREO ) && ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_MONO ) )
#ifdef HODIRAC
        || ( last_ivas_total_brate >= IVAS_256k && ivas_total_brate < IVAS_256k )
		|| ( last_ivas_total_brate <  IVAS_256k && ivas_total_brate >= IVAS_256k ) 
#endif		
		)
#endif
    {
        DIRAC_CONFIG_FLAG flag_config;