Commit ca44ea50 authored by Marek Szczerba's avatar Marek Szczerba
Browse files

Fixed handling of unitialized acoustic envrionment ID

parent 70cbfbcc
Loading
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -448,8 +448,9 @@ int main(

    asked_frame_size = arg.renderFramesize;
#ifdef FIX_1053_REVERB_RECONFIGURATION
    uint16_t aeID = arg.aeSequence.count > 0 ? arg.aeSequence.pID[0] : 65535;
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain,
                                       arg.Opt_dpid_on, arg.aeSequence.pID[0], arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
                                       arg.Opt_dpid_on, aeID, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#else
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain,
                                       arg.Opt_dpid_on, arg.acousticEnvironmentId, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
@@ -678,7 +679,7 @@ int main(
        if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        {
#ifdef FIX_1053_REVERB_RECONFIGURATION
            if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, arg.aeSequence.pID[0], &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
            if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, aeID, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
#else
            if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, arg.acousticEnvironmentId, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
#endif
@@ -692,7 +693,7 @@ int main(
            else
            {
#ifdef FIX_1053_REVERB_RECONFIGURATION
                fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", arg.aeSequence.pID[0] );
                fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", aeID );
#else
                fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", arg.acousticEnvironmentId );
#endif