Commit 8c43b714 authored by PLAINSI's avatar PLAINSI
Browse files

Fix multi-rate crash

parent 0b77d4af
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -182,7 +182,7 @@



#define MC_PARAMUPMIX_MODE
#define MC_PARAMUPMIX_MODE                              /* Dlb: Contribution 39: Multichannel Parametric Upmix */

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
+24 −1
Original line number Diff line number Diff line
@@ -684,6 +684,13 @@ static ivas_error ivas_mc_enc_reconfig(

        if ( last_mc_mode != MC_MODE_MCT )
        {
#ifdef MC_PARAMUPMIX_MODE
            if ( st_ivas->hLFE != NULL )
            {
                /* LFE handle */
                ivas_lfe_enc_close( &( st_ivas->hLFE ) );
            }
#endif
            /* create LFE handle */
            if ( ( error = ivas_create_lfe_enc( &st_ivas->hLFE, st_ivas->hEncoderConfig->input_Fs ) ) != IVAS_ERR_OK )
            {
@@ -711,8 +718,14 @@ static ivas_error ivas_mc_enc_reconfig(
        st_ivas->nCPE = MC_PARAMUPMIX_MAX_TRANSPORT_CHANS / 2;
        st_ivas->nchan_transport = MC_PARAMUPMIX_MAX_TRANSPORT_CHANS;

        if ( last_mc_mode != MC_MODE_MCT )
        if ( last_mc_mode != MC_MODE_PARAMUPMIX )
        {
            if ( st_ivas->hLFE != NULL )
            {
                /* LFE handle */
                ivas_lfe_enc_close( &( st_ivas->hLFE ) );
            }

            /* create LFE handle */
            if ( ( error = ivas_create_lfe_enc( &st_ivas->hLFE, st_ivas->hEncoderConfig->input_Fs ) ) != IVAS_ERR_OK )
            {
@@ -771,6 +784,11 @@ static ivas_error ivas_mc_enc_reconfig(
        }
#ifdef MC_PARAMUPMIX_MODE
        ivas_mc_paramupmix_enc_close( &( st_ivas->hMCParamUpmix ), st_ivas->hEncoderConfig->input_Fs );
        if ( last_mc_mode == MC_MODE_PARAMUPMIX && st_ivas->hLFE != NULL )
        {
            /* LFE handle */
            ivas_lfe_enc_close( &( st_ivas->hLFE ) );
        }
#endif

        ivas_qmetadata_close( &st_ivas->hQMetaData );
@@ -820,6 +838,11 @@ static ivas_error ivas_mc_enc_reconfig(
        ivas_param_mc_enc_close( &( st_ivas->hParamMC ), st_ivas->hEncoderConfig->input_Fs );
#ifdef MC_PARAMUPMIX_MODE
        ivas_mc_paramupmix_enc_close( &( st_ivas->hMCParamUpmix ), st_ivas->hEncoderConfig->input_Fs );
        if ( last_mc_mode == MC_MODE_PARAMUPMIX && st_ivas->hLFE != NULL )
        {
            /* LFE handle */
            ivas_lfe_enc_close( &( st_ivas->hLFE ) );
        }
#endif

        if ( last_mc_mode == MC_MODE_MCT )