Commit 9a2955a1 authored by vaclav's avatar vaclav
Browse files

fix

parent c3478cf3
Loading
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -4375,9 +4375,7 @@ static ivas_error restartDecoder(

    IVAS_AUDIO_CONFIG outputConfig = ( decMode == IVAS_DEC_MODE_IVAS ) ? arg->outputConfig : IVAS_AUDIO_CONFIG_MONO;

#ifdef FIX_FMSW_DEC
    // the calling of following 3 functions could be avoided as well
#endif
    /* thought not needed for configuration of parameters, it is needed to initilize the decoder */
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg->output_Fs, outputConfig, arg->render_num_subframes, arg->customLsOutputEnabled, arg->hrtfReaderEnabled,
                                       arg->enableHeadRotation, arg->enableExternalOrientation, arg->orientation_tracking, arg->renderConfigEnabled, arg->roomSize, arg->non_diegetic_pan_enabled,
                                       arg->non_diegetic_pan_gain, arg->dpidEnabled, aeID, arg->objEditEnabled, arg->delayCompensationEnabled ) ) != IVAS_ERR_OK )
@@ -4386,6 +4384,7 @@ static ivas_error restartDecoder(
        goto cleanup;
    }

#ifndef FIX_FMSW_DEC
    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 )
@@ -4401,7 +4400,6 @@ static ivas_error restartDecoder(
        goto cleanup;
    }

#ifndef FIX_FMSW_DEC
    if ( arg->voipMode )
    {
        if ( ( error = IVAS_DEC_EnableVoIP( hIvasDec, 60, arg->inputFormat ) ) != IVAS_ERR_OK )
+4 −0
Original line number Diff line number Diff line
@@ -434,7 +434,11 @@ void destroy_core_dec(
);

void ivas_destroy_dec(
#ifdef FIX_FMSW_DEC
    Decoder_Struct **st_ivas                                    /* i/o: IVAS decoder structure                  */
#else
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                  */
#endif
);

void ivas_initialize_handles_dec(
+11 −3
Original line number Diff line number Diff line
@@ -2855,10 +2855,17 @@ void ivas_initialize_handles_dec(
 *-------------------------------------------------------------------------*/

void ivas_destroy_dec(
#ifdef FIX_FMSW_DEC
    Decoder_Struct **st_ivas_out /* i/o: IVAS decoder handle      */
#else
    Decoder_Struct *st_ivas /* i/o: IVAS decoder handle      */
#endif
)
{
    int16_t i;
#ifdef FIX_FMSW_DEC
    Decoder_Struct *st_ivas = *st_ivas_out;
#endif

    /* CLDFB handles */
    for ( i = 0; i < MAX_INTERN_CHANNELS; i++ )
@@ -3090,10 +3097,11 @@ void ivas_destroy_dec(
#ifdef FIX_FMSW_DEC
    if ( st_ivas->restartNeeded == 0 )
    {
#endif
        free( st_ivas );
#ifdef FIX_FMSW_DEC
        free( *st_ivas_out );
        *st_ivas_out = NULL;
    }
#else
    free( st_ivas );
#endif

    return;
+16 −16
Original line number Diff line number Diff line
@@ -154,6 +154,8 @@ ivas_error IVAS_DEC_Open(
    if ( ( *phIvasDec ) != NULL && ( *phIvasDec )->st_ivas != NULL && ( *phIvasDec )->st_ivas->restartNeeded != 0 )
    {
        hIvasDec = *phIvasDec;

        st_ivas = hIvasDec->st_ivas;
    }
    else
    {
@@ -211,10 +213,6 @@ ivas_error IVAS_DEC_Open(
        {
            return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for Decoder config structure" );
        }
        hIvasDec->st_ivas->restartNeeded = 0;
#ifdef FIX_FMSW_DEC
    }
#endif

        /*-----------------------------------------------------------------*
         * Initialize IVAS-codec decoder state
@@ -223,12 +221,10 @@ ivas_error IVAS_DEC_Open(
        st_ivas = hIvasDec->st_ivas;
    
        /* initialize Decoder Config. handle */
#ifdef FIX_FMSW_DEC
    if ( st_ivas->restartNeeded == 0 )
    {
#endif
         init_decoder_config( hIvasDec->st_ivas->hDecoderConfig );

#ifdef FIX_FMSW_DEC
         hIvasDec->st_ivas->restartNeeded = 0;
    }
#endif

@@ -371,6 +367,9 @@ void IVAS_DEC_Close(
        ivas_destroy_handle_isar( &( *phIvasDec )->st_ivas->hSplitBinRend );

        /* destroy IVAS decoder handles */
#ifdef FIX_FMSW_DEC
        ivas_destroy_dec( &( *phIvasDec )->st_ivas );
#else
        ivas_destroy_dec( ( *phIvasDec )->st_ivas );
#ifdef FIX_FMSW_DEC
        if ( ( *phIvasDec )->st_ivas->restartNeeded == 0 )
@@ -379,11 +378,12 @@ void IVAS_DEC_Close(
            ( *phIvasDec )->st_ivas = NULL;
#ifdef FIX_FMSW_DEC
        }
#endif
#endif
    }

#ifdef FIX_FMSW_DEC
    if ( ( *phIvasDec )->st_ivas->restartNeeded == 0 )
    if ( ( *phIvasDec )->st_ivas == NULL || ( *phIvasDec )->st_ivas->restartNeeded == 0 )
    {
#endif
        apa_exit( &( *phIvasDec )->hTimeScaler );