Skip to content

Obsolete call of ivas_jbm_dec_tc_buffer_open()

In function ivas_init_decoder(), there is an obsolete (and confusing) logic:

    if ( st_ivas->hTcBuffer == NULL )
    {
        if ( ( error = ivas_jbm_dec_tc_buffer_open( ... ) ) != IVAS_ERR_OK )
        {
            return error;
        }
    }

    if ( st_ivas->hTcBuffer == NULL )
    {
        /* we need the handle anyway, but without the buffer*/
        if ( ( error = ivas_jbm_dec_tc_buffer_open( ... ) ) != IVAS_ERR_OK )
        {
            return error;
        }
    }

The first call of ivas_jbm_dec_tc_buffer_open() allocates the handle st_ivas->hTcBuffer so the second call of ivas_jbm_dec_tc_buffer_open() is useless.

Then, the parameter tc_buffer_mode is never set to TC_BUFFER_MODE_NONE so this enum member can be removed. See also https://ivas-codec-pc.3gpp.org/ivas-codec/coverage/lib_dec/ivas_jbm_dec.c.gcov.html, lines 2383-7, which are never hit by the coverage tests.