Commit f6923e0c authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

extend fix to SBA mode

parent 45bce1e0
Loading
Loading
Loading
Loading
+16 −10
Original line number Diff line number Diff line
@@ -300,6 +300,10 @@ int16_t ivas_get_nchan_buffers_dec(
    }
    else if ( st_ivas->ivas_format == SBA_FORMAT )
    {
#ifdef NONBE_FIX_798_OSBA_MC_DEC_CRASH
        int16_t nchan_internal;
        nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate );
#endif
        nchan_out_buff = st_ivas->hDecoderConfig->nchan_out;

        if ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM )
@@ -311,6 +315,9 @@ int16_t ivas_get_nchan_buffers_dec(
            nchan_out_buff = max( audioCfg2channels( st_ivas->transport_config ), audioCfg2channels( st_ivas->intern_config ) );
            nchan_out_buff = max( nchan_out_buff, audioCfg2channels( output_config ) );
        }
#ifdef NONBE_FIX_798_OSBA_MC_DEC_CRASH
        nchan_out_buff = max( nchan_out_buff, nchan_internal + st_ivas->nchan_ism );
#endif
    }
    else if ( st_ivas->ivas_format == MASA_FORMAT )
    {
@@ -342,6 +349,10 @@ int16_t ivas_get_nchan_buffers_dec(
    }
    else if ( st_ivas->ivas_format == SBA_ISM_FORMAT )
    {
#ifdef NONBE_FIX_798_OSBA_MC_DEC_CRASH
        int16_t nchan_internal;
        nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate );
#endif
        nchan_out_buff = st_ivas->nchan_ism + st_ivas->nchan_transport;

        if ( st_ivas->hMCT != NULL )
@@ -358,22 +369,17 @@ int16_t ivas_get_nchan_buffers_dec(
            nchan_out_buff = max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) );
            nchan_out_buff = max( nchan_out_buff, audioCfg2channels( output_config ) );


            if ( st_ivas->renderer_type == RENDERER_OSBA_AMBI || st_ivas->renderer_type == RENDERER_OSBA_LS )
            {
#ifdef NONBE_FIX_798_OSBA_MC_DEC_CRASH
                int16_t nchan_internal;
                nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate );
#endif
                nchan_out_buff = max( nchan_out_buff + st_ivas->nchan_ism, audioCfg2channels( output_config ) ); /* needed for ivas_sba_upmixer_renderer() */
#ifdef NONBE_FIX_798_OSBA_MC_DEC_CRASH
                nchan_out_buff = max( nchan_out_buff, nchan_internal + st_ivas->nchan_ism );
#endif
			}
            else
            {
                nchan_out_buff = max( nchan_out_buff + st_ivas->nchan_ism, audioCfg2channels( output_config ) ); /* needed for iivas_spar_dec_upmixer_sf() which is based on 'nchan_out' */
            }
#ifdef NONBE_FIX_798_OSBA_MC_DEC_CRASH
            nchan_out_buff = max( nchan_out_buff, nchan_internal + st_ivas->nchan_ism );
#endif
        }
        else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL )
        {