Commit c8aeac66 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch 'ltv_omasa_crash_issue_fix' into 'main'

Fix for LTV crash issues observed with OMASA format after BASOP changes

See merge request !425
parents 77409e44 567b85c3
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -151,13 +151,22 @@ void tdm_configure_dec(
    Word16 mod_ct, core, bits_offset;
    Word16 idx_LRTD_pri_side, tdm_inst_ratio_idx;
    Word32 element_brate_adapt;
    Word16 bstr_last_pos;
    Word16 bstr_last_pos, temp;

    hStereoTD = hCPE->hStereoTD;
    sts = hCPE->hCoreCoder;

    element_brate_adapt = L_add( hCPE->element_brate, hCPE->brate_surplus );
    bstr_last_pos = add( sub( div_l( hCPE->element_brate, FRAMES_PER_SEC / 2 ), nb_bits_metadata ), div_l( hCPE->brate_surplus, FRAMES_PER_SEC / 2 ) );

    IF( hCPE->brate_surplus < 0 )
    {
        temp = extract_l( L_negate( Mpy_32_32( L_abs( hCPE->brate_surplus ), ONE_BY_FRAMES_PER_SEC_Q31 ) ) );
    }
    ELSE
    {
        temp = extract_l( Mpy_32_32( hCPE->brate_surplus, ONE_BY_FRAMES_PER_SEC_Q31 ) );
    }
    bstr_last_pos = add( sub( div_l( hCPE->element_brate, FRAMES_PER_SEC / 2 ), nb_bits_metadata ), temp );

    /*----------------------------------------------------------------*
     * Decode CoreCoder signaling