Commit 696f7dc6 authored by multrus's avatar multrus
Browse files

[cleanup] accept IMPROVE_CMDLINE_ROBUSTNESS

parent a133128e
Loading
Loading
Loading
Loading
+0 −27
Original line number Diff line number Diff line
@@ -1273,20 +1273,14 @@ static bool parseCmdlIVAS_enc(
            arg->inputFormat = IVAS_ENC_INPUT_ISM;
            i++;

#ifdef IMPROVE_CMDLINE_ROBUSTNESS
            if ( i < argc - 4 )
#else
            if ( i < argc - 5 )
#endif
            {
#ifdef IMPROVE_CMDLINE_ROBUSTNESS
                if ( !is_digits_only( argv[i] ) )
                {
                    fprintf( stderr, "Error: Number of ISM channels must be an integer number!\n\n" );
                    usage_enc();
                    return false;
                }
#endif

                if ( sscanf( argv[i], "%d", &tmp ) > 0 )
                {
@@ -1299,14 +1293,12 @@ static bool parseCmdlIVAS_enc(
                    usage_enc();
                    return false;
                }
#ifdef IMPROVE_CMDLINE_ROBUSTNESS
                else if ( tmp > IVAS_MAX_NUM_OBJECTS )
                {
                    fprintf( stderr, "Error: Too high number of ISM channels specified!\n\n" );
                    usage_enc();
                    return false;
                }
#endif
                else
                {
                    arg->inputFormatConfig.ism.numObjects = (int16_t) tmp;
@@ -1338,11 +1330,7 @@ static bool parseCmdlIVAS_enc(
                }
                else
                {
#ifdef IMPROVE_CMDLINE_ROBUSTNESS
                    fprintf( stderr, "Error: not enough metadata arguments specified!\n\n" );
#else
                    fprintf( stderr, "Error: not enough arguments\n\n" );
#endif
                    usage_enc();
                    return false;
                }
@@ -1355,19 +1343,10 @@ static bool parseCmdlIVAS_enc(

            /* SBA configuration */
            if ( i < argc - 4
#ifdef IMPROVE_CMDLINE_ROBUSTNESS
                 && is_number( argv[i] ) && sscanf( argv[i], "%d", &tmp ) > 0
#endif
            )
            {
#ifndef IMPROVE_CMDLINE_ROBUSTNESS
                if ( sscanf( argv[i], "%d", &tmp ) > 0 )
                {
#endif
                    i++;
#ifndef IMPROVE_CMDLINE_ROBUSTNESS
                }
#endif
            }
            else
            {
@@ -1404,14 +1383,12 @@ static bool parseCmdlIVAS_enc(

            if ( i < argc - 4 )
            {
#ifdef IMPROVE_CMDLINE_ROBUSTNESS
                if ( !is_digits_only( argv[i] ) )
                {
                    fprintf( stderr, "Error: Number of MASA channels must be an integer number!\n\n" );
                    usage_enc();
                    return false;
                }
#endif

                if ( sscanf( argv[i], "%d", &tmp ) > 0 )
                {
@@ -1427,11 +1404,7 @@ static bool parseCmdlIVAS_enc(
                        arg->inputFormatConfig.masaVariant = IVAS_ENC_MASA_2CH;
                        break;
                    default:
#ifdef IMPROVE_CMDLINE_ROBUSTNESS
                        fprintf( stderr, "Error: MASA channels must be 1 or 2.\n\n" );
#else
                        fprintf( stderr, "Error: MASA channels must for the moment be 1 or 2.\n\n" );
#endif
                        usage_enc();
                        return false;
                }
+0 −1
Original line number Diff line number Diff line
@@ -149,7 +149,6 @@
#define BRATE_SWITCHING_RENDERING                       /* Bitrate switching changes related to the renderers */
#define FIX_150                                         /* Issue 150: Crash in EVS mono, HQ_HARMONIC mode, related to BASOP_NOGLOB */
#define FIX_VBR_COMPLEXITY                              /* Issue 234: fix extremely high complexity numbers for IVAS EVS mode */
#define IMPROVE_CMDLINE_ROBUSTNESS                      /* Issue 233: Improve robustness of command-line parameters */
#define FIX_MDCT_AND_MC_MONO_ISSUES                     /* Issue 242: Fix some issues with TCX-LTP and delay alignement for mono output */

/* ################## End DEVELOPMENT switches ######################### */