Commit aaec1abf authored by vaclav's avatar vaclav
Browse files

fix: avoid restart in the first frame

parent 828b2dbb
Loading
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -4371,11 +4371,11 @@ static ivas_error restartDecoder(

    hIvasDec = *phIvasDec;

#ifndef FIX_FMSW_DEC
    uint16_t aeID = arg->aeSequence.count > 0 ? arg->aeSequence.pID[0] : IVAS_DEFAULT_AEID;

    IVAS_AUDIO_CONFIG outputConfig = ( decMode == IVAS_DEC_MODE_IVAS ) ? arg->outputConfig : IVAS_AUDIO_CONFIG_MONO;

    /* thought not needed for configuration of parameters, it is needed to initilize the decoder */
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg->output_Fs, outputConfig, arg->render_num_subframes, arg->customLsOutputEnabled, arg->hrtfReaderEnabled,
                                       arg->enableHeadRotation, arg->enableExternalOrientation, arg->orientation_tracking, arg->renderConfigEnabled, arg->roomSize, arg->non_diegetic_pan_enabled,
                                       arg->non_diegetic_pan_gain, arg->dpidEnabled, aeID, arg->objEditEnabled, arg->delayCompensationEnabled ) ) != IVAS_ERR_OK )
@@ -4384,7 +4384,6 @@ static ivas_error restartDecoder(
        goto cleanup;
    }

#ifndef FIX_FMSW_DEC
    if ( arg->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
        if ( ( error = IVAS_DEC_EnableSplitRendering( hIvasDec ) ) != IVAS_ERR_OK )
+18 −10
Original line number Diff line number Diff line
@@ -3051,6 +3051,10 @@ void ivas_destroy_dec(
    /* HRTF statistics */
    ivas_HRTF_statistics_binary_close( &st_ivas->hHrtfStatistics );

#ifdef FIX_FMSW_DEC
    if ( st_ivas->restartNeeded == 0 )
    {
#endif
        /* Config. Renderer */
        ivas_render_config_close( &( st_ivas->hRenderConfig ) );
    
@@ -3061,10 +3065,6 @@ void ivas_destroy_dec(
            st_ivas->pAcousticEnvironments = NULL;
        }
    
#ifdef FIX_FMSW_DEC
    if ( st_ivas->restartNeeded == 0 )
    {
#endif
        /* Limiter struct */
        ivas_limiter_close( &( st_ivas->hLimiter ) );

@@ -3076,6 +3076,14 @@ void ivas_destroy_dec(
        }
#ifdef FIX_FMSW_DEC
    }
    else
    {
        /* resets in case of format switching */
        st_ivas->nchan_ism = 0;
        st_ivas->ism_mode = ISM_MODE_NONE;
        st_ivas->mc_mode = MC_MODE_NONE;
        st_ivas->sba_dirac_stereo_flag = 0;
    }
#endif

    /* TC buffer structure */
+3 −0
Original line number Diff line number Diff line
@@ -82,6 +82,9 @@
/* IVAS Codec Types */
typedef enum
{
#ifdef FIX_FMSW_DEC
    IVAS_RTP_UNDEF, /* undefined = Codec Type not set yet */
#endif
    IVAS_RTP_EVS, /* EVS  */
    IVAS_RTP_IVAS /* IVAS */
} IVAS_RTP_CODEC;
+10 −6
Original line number Diff line number Diff line
@@ -1041,8 +1041,12 @@ ivas_error IVAS_RTP_ReadNextFrame(
    }
    else
    {
#ifdef FIX_FMSW_DEC
        if ( ( codecId != IVAS_RTP_UNDEF ) && ( ( rtp->codecId != codecId ) || ( codecId == IVAS_RTP_EVS && ( rtp->isAMRWB_IOmode != isAMRWB_IOmode ) ) ) )
#else
        rtp->restartNeeded = ( rtp->codecId != codecId ) ||
                             ( codecId == IVAS_RTP_EVS && ( rtp->isAMRWB_IOmode != isAMRWB_IOmode ) );
#endif

            if ( rtp->restartNeeded )
            {