Commit 30c2cec0 authored by vaclav's avatar vaclav
Browse files

issue 708: improve AEID command-line robustness; under FIX_708_AEID_COMMAND_LINE

parent 8bef1c48
Loading
Loading
Loading
Loading
Loading
+25 −1
Original line number Diff line number Diff line
@@ -511,7 +511,11 @@ int main(
#ifdef API_5MS_BASELINE
                                       arg.tsmEnabled, arg.enable5ms,
#endif
                                       arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
                                       arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain,
#ifdef FIX_708_AEID_COMMAND_LINE
                                       arg.acousticEnvironmentId,
#endif
                                       arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
        goto cleanup;
@@ -1115,11 +1119,16 @@ static bool parseCmdlIVAS_dec(
#endif
#endif

#ifdef FIX_708_AEID_COMMAND_LINE
    arg->acousticEnvironmentId = 65535;
#else
    arg->acousticEnvironmentId = 0;
#endif
    for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i )
    {
        arg->directivityPatternId[i] = 0;
    }

    /*-----------------------------------------------------------------*
     * Initialization
     *-----------------------------------------------------------------*/
@@ -1497,6 +1506,21 @@ static bool parseCmdlIVAS_dec(
        else if ( strcmp( argv_to_upper, "-AEID" ) == 0 )
        {
            ++i;
#ifdef FIX_708_AEID_COMMAND_LINE
            if ( argc - i <= 4 )
            {
                fprintf( stderr, "Error: Acoustic environment ID not specified!\n\n" );
                usage_dec();
                return false;
            }

            if ( !is_digits_only( argv[i] ) )
            {
                fprintf( stdout, "Error: Invalid acoustic environment ID specified: %s\n\n", argv[i] );
                usage_dec();
                return false;
            }
#endif
            arg->acousticEnvironmentId = (int16_t) atoi( argv[i++] );
        }
        else if ( strcmp( argv_to_upper, "-DPID" ) == 0 )
+5 −0
Original line number Diff line number Diff line
@@ -2692,7 +2692,12 @@ static CmdlnArgs defaultArgs(
        args.directivityPatternId[i] = 0;
    }

#ifdef FIX_708_AEID_COMMAND_LINE
    args.acousticEnvironmentId = 65535;
#else
    args.acousticEnvironmentId = 0;
#endif

    return args;
}

+7 −0
Original line number Diff line number Diff line
@@ -76,6 +76,9 @@ typedef enum
    IVAS_ERR_INVALID_OUTPUT_FORMAT,
    IVAS_ERR_HEAD_ROTATION_NOT_SUPPORTED,
    IVAS_ERR_EXT_ORIENTATION_NOT_SUPPORTED,
#ifdef FIX_708_AEID_COMMAND_LINE
    IVAS_ERR_ACOUSTIC_ENVIRONMENT_NOT_SUPPORTED,
#endif
    IVAS_ERR_INVALID_HRTF,
    IVAS_ERR_INVALID_INPUT_FORMAT,
    IVAS_ERR_INVALID_INDEX, /* ToDo: should be merged with IVAS_ERR_INDEX_OUT_OF_BOUNDS */
@@ -253,6 +256,10 @@ static inline const char *ivas_error_to_string( ivas_error error_code )
#endif
        case IVAS_ERR_EXT_ORIENTATION_NOT_SUPPORTED:
            return "External orientation not supported";
#ifdef FIX_708_AEID_COMMAND_LINE
        case IVAS_ERR_ACOUSTIC_ENVIRONMENT_NOT_SUPPORTED:
            return "Acoustic environment not supported";
#endif
        case IVAS_ERR_INVALID_HRTF:
            return "Unsupported HRTF filter set";
        case IVAS_ERR_INVALID_INPUT_FORMAT:
+2 −0
Original line number Diff line number Diff line
@@ -168,6 +168,8 @@
#define FIX_718_JBM_MD_UDPATE                           /* Fhg: fix issue #718, wrong setting of the update flag in the TD obj renderer in the JBM path */
#define FIX_719_CRASH_IN_CLEANUP                        /* VA: issue 719: fix Decoder crash after call to goto to cleanup */

#define FIX_708_AEID_COMMAND_LINE                       /* issue 708: improve AEID command-line robustness */


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

+10 −0
Original line number Diff line number Diff line
@@ -3109,6 +3109,16 @@ static ivas_error doSanityChecks_IVAS(
        }
    }

#ifdef FIX_708_AEID_COMMAND_LINE
    if ( st_ivas->hDecoderConfig->Opt_aeid_on )
    {
        if ( output_config != AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        {
            return IVAS_ERROR( IVAS_ERR_ACOUSTIC_ENVIRONMENT_NOT_SUPPORTED, "Wrong set-up: Acoustic environment is not supported in this output configuration." );
        }
    }
#endif

    if ( st_ivas->ivas_format == MASA_ISM_FORMAT )
    {
        if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC && output_config == AUDIO_CONFIG_EXTERNAL )
Loading