Commit d817b428 authored by vaclav's avatar vaclav
Browse files

fix non-JBM BR switching crash

parent 6f627602
Loading
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -2395,7 +2395,10 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure(
#ifdef FIX_NCHAN_BUFFERS
    /* 2 channels of the TC buffer for smooth transition in bitrate swithing within 1 CPE and TD decorr. on and off */
    num_tc_buffer_mem = min( hTcBuffer->nchan_buffer_full, CPE_CHANNELS );
    if ( st_ivas->hDecoderConfig->Opt_tsm )
    {
        mvr2r( hTcBuffer->tc_buffer, tc_buffer_mem, num_tc_buffer_mem * NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ) );
    }

#endif
    /* if granularity changes, adapt subframe_nb_slots */
@@ -2503,7 +2506,10 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure(
    }

#ifdef FIX_NCHAN_BUFFERS
    if ( st_ivas->hDecoderConfig->Opt_tsm )
    {
        mvr2r( tc_buffer_mem, hTcBuffer->tc_buffer, num_tc_buffer_mem * NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ) );
    }

#endif
    return IVAS_ERR_OK;