Commit f9afcb54 authored by vaclav's avatar vaclav
Browse files

fix memory deallocation in bitrate switching

parent e05ea4c7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1517,7 +1517,7 @@ ivas_error ivas_init_decoder(
    // VE: introduce a new renderer_type for this case
    if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL )
    {
        /* Use td renderer for the objects in DISC mode */
        /* Allocate TD renderer for the objects in DISC mode */
        error = ivas_td_binaural_open_unwrap( &st_ivas->hHrtfTD, st_ivas->hDecoderConfig->output_Fs, st_ivas->nchan_ism, st_ivas->ivas_format,
                                              st_ivas->transport_config, st_ivas->hRenderConfig->directivity, st_ivas->hTransSetup, &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns );
        if ( ( error ) != IVAS_ERR_OK )
@@ -1525,7 +1525,7 @@ ivas_error ivas_init_decoder(
            return error;
        }

        /* Reserve memory for delay buffer */
        /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */
        if ( ( error = ivas_masa_ism_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK )
        {
            return error;
+10 −2
Original line number Diff line number Diff line
@@ -302,7 +302,7 @@ ivas_error ivas_omasa_dec_config(
        // VE: introduce a new renderer_type for this case
        if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC )
        {
            /* Use td renderer for the objects in DISC mode */
            /* Allocate TD renderer for the objects in DISC mode */
            if ( ( error = ivas_td_binaural_open_unwrap( &st_ivas->hHrtfTD, st_ivas->hDecoderConfig->output_Fs, st_ivas->nchan_ism, st_ivas->ivas_format,
                                                         st_ivas->transport_config, st_ivas->hRenderConfig->directivity, st_ivas->hTransSetup,
                                                         &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns ) ) != IVAS_ERR_OK )
@@ -310,7 +310,7 @@ ivas_error ivas_omasa_dec_config(
                return error;
            }

            /* Reserve memory for delay buffer */
            /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */
            if ( ( error = ivas_masa_ism_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK )
            {
                return error;
@@ -318,6 +318,7 @@ ivas_error ivas_omasa_dec_config(
        }
        else
        {
            /* TD renderer handle */
            if ( st_ivas->hBinRendererTd != NULL )
            {
                ivas_td_binaural_close( &st_ivas->hBinRendererTd );
@@ -327,6 +328,13 @@ ivas_error ivas_omasa_dec_config(
            {
                st_ivas->hHrtfTD = NULL;
            }

            /* ISM renderer handle */
            if ( st_ivas->hIsmRendererData != NULL )
            {
                free( st_ivas->hIsmRendererData );
                st_ivas->hIsmRendererData = NULL;
            }
        }
#endif
    }