Commit 131d1774 authored by korse's avatar korse
Browse files

small bugfix to avoid encoder crash

parent 7d93be99
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -896,13 +896,6 @@ static ivas_error configureEncoder(
        return IVAS_ERROR( IVAS_ERR_DTX_NOT_SUPPORTED, "DTX is not supported in this IVAS format and element mode." );
    }

#ifdef PARAM_ISM_DTX_CNG
    if (hEncoderConfig->Opt_DTX_ON && (hEncoderConfig->ivas_format == ISM_FORMAT) && !(st_ivas->ism_mode == ISM_MODE_DISC && hEncoderConfig->nchan_inp == 1) && !(st_ivas->ism_mode == ISM_MODE_PARAM && (hEncoderConfig->nchan_inp == 3 || hEncoderConfig->nchan_inp == 4)))
    {
        return IVAS_ERROR(IVAS_ERR_UNKNOWN, "DTX is not supported in this IVAS format and element mode.");
    }
#endif

    if ( hEncoderConfig->Opt_AGC_ON && !( hEncoderConfig->ivas_format == SBA_FORMAT && ivas_sba_mode_select( hEncoderConfig->ivas_total_brate ) == SBA_MODE_SPAR ) )
    {
        return IVAS_ERROR( IVAS_ERR_NOT_SUPPORTED_OPTION, "AGC supported in SBA format at bitrates >= 24.4 kbps only." );
@@ -922,6 +915,13 @@ static ivas_error configureEncoder(
        return error;
    }

#ifdef PARAM_ISM_DTX_CNG
    if (hEncoderConfig->Opt_DTX_ON && (hEncoderConfig->ivas_format == ISM_FORMAT) && !(st_ivas->ism_mode == ISM_MODE_DISC && hEncoderConfig->nchan_inp == 1) && !(st_ivas->ism_mode == ISM_MODE_PARAM && (hEncoderConfig->nchan_inp == 3 || hEncoderConfig->nchan_inp == 4)))
    {
        return IVAS_ERROR(IVAS_ERR_UNKNOWN, "DTX is not supported in this IVAS format and element mode.");
    }
#endif

    if ( hEncoderConfig->ivas_format == MONO_FORMAT )
    {
        hIvasEnc->hCoreCoder = st_ivas->hSCE[0]->hCoreCoder[0]; /* Note: this is needed for switching in EVS mono */