Commit 0d25834c authored by vaclav's avatar vaclav
Browse files

fix VBR option exit + properly return an error for IVAS_ENC_PrintConfig()

parent c4a82e25
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -479,7 +479,11 @@ int main(
            goto cleanup;
    }

    IVAS_ENC_PrintConfig( hIvasEnc, caConfig.channelAwareModeEnabled );
    if( ( error = IVAS_ENC_PrintConfig( hIvasEnc, caConfig.channelAwareModeEnabled ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\n IVAS_ENC_PrintConfig failed %s\n\n", IVAS_ENC_GetErrorMessage( error ) );
        goto cleanup;
    }

    /*------------------------------------------------------------------------------------------*
     * Open input metadata files
+6 −6
Original line number Diff line number Diff line
@@ -1317,7 +1317,9 @@ const char *IVAS_ENC_GetErrorMessage(
        case IVAS_ERR_OK:
            return "no error";
        case IVAS_ERR_FAILED_ALLOC:
            return "memory error";
            return "Failed allocation error";
        case IVAS_ERR_WRONG_PARAMS:
            return "wrong parameters";
        case IVAS_ERR_INVALID_BANDWIDTH:
            return "invalid bandwidth";
        case IVAS_ERR_INVALID_DTX_UPDATE_RATE:
@@ -1544,7 +1546,7 @@ static ivas_error printConfigInfo_enc(

    if ( st_ivas->hEncoderConfig->Opt_SC_VBR && !hEncoderConfig->Opt_DTX_ON )
    {
        return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "\nError: SC-VBR 5900 bps not supported without DTX\n\n" );
        return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "\nError: SC-VBR 5900 bps not supported without DTX\n\n" );
    }

    if ( hIvasEnc->maxBandwidthUser )
@@ -1998,14 +2000,12 @@ static ivas_error forcedModeApiToInternal(
 *
 *---------------------------------------------------------------------*/

void IVAS_ENC_PrintConfig(
ivas_error IVAS_ENC_PrintConfig(
    const IVAS_ENC_HANDLE hIvasEnc,       /* i  : IVAS encoder handle             */
    const int16_t channelAwareModeEnabled /* i  : channel-aware mode enabled flag */
)
{
    printConfigInfo_enc( hIvasEnc, channelAwareModeEnabled );

    return;
    return printConfigInfo_enc( hIvasEnc, channelAwareModeEnabled );
}


+1 −1
Original line number Diff line number Diff line
@@ -316,7 +316,7 @@ const char *IVAS_ENC_GetErrorMessage(
);


void IVAS_ENC_PrintConfig(
ivas_error IVAS_ENC_PrintConfig(
    const IVAS_ENC_HANDLE hIvasEnc,                 /* i  : IVAS encoder handle                                                                                 */
    const int16_t channelAwareModeEnabled           /* i  : channel-aware mode enabled flag                                                                     */
);