Commit 970d9ef6 authored by malenov's avatar malenov
Browse files

fixing re-allocation of the buffer of indices in case of MASA bitrate switching

parent 0f2085bb
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1688,6 +1688,11 @@ void ivas_masa_enc_reconfigure(
            copy_encoder_config( st_ivas, st_ivas->hSCE[sce_id]->hCoreCoder[0], 0 );
            st_ivas->hSCE[sce_id]->element_brate = ivas_total_brate / st_ivas->nchan_transport;
            st_ivas->hSCE[sce_id]->hCoreCoder[0]->total_brate = st_ivas->hSCE[sce_id]->element_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */

#ifdef IND_LIST_DYN
            /* re-allocate list of metadata indices, if needed */
            ind_list_metadata_realloc( st_ivas->hSCE[sce_id]->hMetaData, st_ivas->hEncoderConfig->ivas_format, st_ivas->hEncoderConfig->ivas_total_brate );
#endif
        }

        for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ )
@@ -1699,6 +1704,11 @@ void ivas_masa_enc_reconfigure(
            {
                copy_encoder_config( st_ivas, st_ivas->hCPE[cpe_id]->hCoreCoder[n], 0 );
                st_ivas->hCPE[cpe_id]->hCoreCoder[n]->total_brate = st_ivas->hCPE[cpe_id]->element_brate / ( st_ivas->nCPE > 1 ? 1 : CPE_CHANNELS ); /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */

#ifdef IND_LIST_DYN
                /* re-allocate list of metadata indices, if needed */
                ind_list_metadata_realloc( st_ivas->hCPE[cpe_id]->hMetaData, st_ivas->hEncoderConfig->ivas_format, st_ivas->hEncoderConfig->ivas_total_brate );
#endif
            }

            if ( ivas_total_brate < MASA_STEREO_MIN_BITRATE )