Commit 41867f8f authored by vaclav's avatar vaclav
Browse files

fix memory deallocation at the necoder + comments

parent 5f3531bd
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -1113,7 +1113,7 @@ static ivas_error ivas_ism_format_bitrate_switching(
    {
        /* switching from ParamISM to DiscISM */

        /* close the ParamISM struct */
        /* Deallocate the ParamISM struct */
        if ( st_ivas->hDirAC != NULL )
        {
            ivas_param_ism_dec_close( st_ivas->hDirAC, st_ivas->hDecoderConfig->output_config );
@@ -1151,9 +1151,9 @@ static ivas_error ivas_ism_format_bitrate_switching(

    if ( st_ivas->ism_mode == ISM_MODE_PARAM && last_ism_mode == ISM_MODE_DISC )
    {
        /* switching from DiscISM to ParamISM */
        /* switching from Discrete ISM to ParamISM */

        /* Initialize the ParamISM struct */
        /* Allocate and initialize the ParamISM struct */
        ivas_param_ism_dec_open( st_ivas );

        if ( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL )
+4 −3
Original line number Diff line number Diff line
@@ -503,9 +503,9 @@ ivas_error ivas_ism_enc_config(
            }
        }

        if ( ( st_ivas->ism_mode == ISM_MODE_PARAM ) && ( last_ism_mode == ISM_MODE_DISC ) )
        if ( st_ivas->ism_mode == ISM_MODE_PARAM && last_ism_mode == ISM_MODE_DISC )
        {
            /* Initialize the memory used by ParamISM when switch to Param ISM from Disc ISM */
            /* Allocate and Initialize the memory used by ParamISM when switch from Discrete ISM */
            if ( ( error = ivas_param_ism_enc_open( st_ivas ) ) != IVAS_ERR_OK )
            {
                return error;
@@ -514,8 +514,9 @@ ivas_error ivas_ism_enc_config(

        if ( ( st_ivas->ism_mode == ISM_MODE_DISC ) && ( last_ism_mode == ISM_MODE_PARAM ) )
        {
            /* Reset the memory used by ParamISM when switch to Disc ISM */
            /* Deallocate the memory used by ParamISM when switch to Discrete ISM */
            ivas_param_ism_enc_close( st_ivas->hDirAC, st_ivas->hEncoderConfig->input_Fs );
            st_ivas->hDirAC = NULL;
        }

        /* destroy the memory of hp20*/