Commit 9e99e2a9 authored by vaclav's avatar vaclav
Browse files

- Merge remote-tracking branch 'remotes/origin/main' into...

- Merge remote-tracking branch 'remotes/origin/main' into 880-functions-renaming-after-nonbe_unified_decoding_paths
parents 689f4261 98c8bc51
Loading
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -2464,6 +2464,9 @@ coverage-test-on-main-scheduled:
    - *print-common-info
    - *print-common-info
    - *update-ltv-repo
    - *update-ltv-repo
    - *complexity-measurements-setup
    - *complexity-measurements-setup
  allow_failure:
    exit_codes:
      - 123
  artifacts:
  artifacts:
    name: "$CI_JOB_NAME--$CI_COMMIT_REF_NAME--sha-$CI_COMMIT_SHA"
    name: "$CI_JOB_NAME--$CI_COMMIT_REF_NAME--sha-$CI_COMMIT_SHA"
    when: always
    when: always
+2 −2
Original line number Original line Diff line number Diff line
@@ -29,7 +29,7 @@
#        cmake --build . --config Release
#        cmake --build . --config Release




cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.10)


set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD 99)


@@ -121,7 +121,7 @@ if(WMOPS)
  add_definitions("-DWMOPS=1")
  add_definitions("-DWMOPS=1")
endif()
endif()


project(stereo-evs)
project(stereo-evs LANGUAGES C)
set_property(GLOBAL PROPERTY USE_FOLDERS ON) # make Visual Studio projects look nicer
set_property(GLOBAL PROPERTY USE_FOLDERS ON) # make Visual Studio projects look nicer
include(CTest)
include(CTest)


+2 −1
Original line number Original line Diff line number Diff line
@@ -665,7 +665,8 @@ int main(


            if ( ( error = IVAS_DEC_SetRenderFramesize( hIvasDec, arg.renderFramesize ) ) != IVAS_ERR_OK )
            if ( ( error = IVAS_DEC_SetRenderFramesize( hIvasDec, arg.renderFramesize ) ) != IVAS_ERR_OK )
            {
            {
                return error;
                fprintf( stderr, "\nIVAS_DEC_PrintConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
                goto cleanup;
            }
            }


            if ( arg.renderFramesize != asked_frame_size )
            if ( arg.renderFramesize != asked_frame_size )
+80 −57
Original line number Original line Diff line number Diff line
@@ -681,19 +681,19 @@ int main(
    int argc,
    int argc,
    char **argv )
    char **argv )
{
{
    ISAR_POST_REND_HANDLE hIsarPostRend;
    ISAR_POST_REND_HANDLE hIsarPostRend = NULL;
    RotFileReader *headRotReader = NULL;
    RotFileReader *headRotReader = NULL;
    RotFileReader *externalOrientationFileReader = NULL;
    RotFileReader *externalOrientationFileReader = NULL;
    SplitRendBFIFileReader *splitRendBFIReader = NULL;
    SplitRendBFIFileReader *splitRendBFIReader = NULL;
    AudioFileReader *audioReader = NULL;
    AudioFileReader *audioReader = NULL;
    AudioFileWriter *audioWriter;
    AudioFileWriter *audioWriter = NULL;
    int32_t inBufferSize;
    int32_t inBufferSize;
    int32_t outBufferSize;
    int32_t outBufferSize;
    int32_t bitsBufferSize;
    int32_t bitsBufferSize;
    int16_t *inpInt16Buffer;
    int16_t *inpInt16Buffer = NULL;
    float *inFloatBuffer;
    float *inFloatBuffer = NULL;
    int16_t *outInt16Buffer;
    int16_t *outInt16Buffer = NULL;
    float *outFloatBuffer;
    float *outFloatBuffer = NULL;
    uint8_t *bitsBufferData = NULL;
    uint8_t *bitsBufferData = NULL;
    IVAS_REND_AudioBuffer inBuffer;
    IVAS_REND_AudioBuffer inBuffer;
    IVAS_REND_AudioBuffer outBuffer;
    IVAS_REND_AudioBuffer outBuffer;
@@ -744,8 +744,8 @@ int main(
    {
    {
        if ( RotationFileReader_open( args.headRotationFilePath, &headRotReader ) != IVAS_ERR_OK )
        if ( RotationFileReader_open( args.headRotationFilePath, &headRotReader ) != IVAS_ERR_OK )
        {
        {
            fprintf( stderr, "Error opening file: %s\n", args.headRotationFilePath );
            fprintf( stderr, "\nError opening file: %s\n", args.headRotationFilePath );
            exit( -1 );
            goto cleanup;
        }
        }
    }
    }


@@ -778,14 +778,14 @@ int main(
                                        &bitsBuffer.config.lc3plusHighRes );
                                        &bitsBuffer.config.lc3plusHighRes );
        if ( error != IVAS_ERR_OK )
        if ( error != IVAS_ERR_OK )
        {
        {
            fprintf( stderr, "Could not open split rend metadata file %s\n", args.inMetadataFilePaths[0] );
            fprintf( stderr, "\nCould not open split rend metadata file %s\n", args.inMetadataFilePaths[0] );
            exit( -1 );
            goto cleanup;
        }
        }


        if ( AudioFileReader_open( &audioReader, audioFilePath ) != IVAS_ERR_OK )
        if ( AudioFileReader_open( &audioReader, audioFilePath ) != IVAS_ERR_OK )
        {
        {
            fprintf( stderr, "Error opening file: %s\n", audioFilePath );
            fprintf( stderr, "\nError opening file: %s\n", audioFilePath );
            exit( -1 );
            goto cleanup;
        }
        }
    }
    }


@@ -802,8 +802,8 @@ int main(
                                        &bitsBuffer.config.lc3plusHighRes );
                                        &bitsBuffer.config.lc3plusHighRes );
        if ( error != IVAS_ERR_OK )
        if ( error != IVAS_ERR_OK )
        {
        {
            fprintf( stderr, "Could not open split rend metadata file %s\n", args.inputFilePath );
            fprintf( stderr, "\nCould not open split rend metadata file %s\n", args.inputFilePath );
            exit( -1 );
            goto cleanup;
        }
        }
        audioReader = NULL;
        audioReader = NULL;
    }
    }
@@ -828,20 +828,20 @@ int main(
            /* else if sampling rate given on command line, compare with wav file */
            /* else if sampling rate given on command line, compare with wav file */
            else if ( inFileSampleRate != args.sampleRate )
            else if ( inFileSampleRate != args.sampleRate )
            {
            {
                fprintf( stderr, "Sampling rate mismatch: %d Hz requested, but %d Hz found in file %s\n", args.sampleRate, inFileSampleRate, args.inputFilePath );
                fprintf( stderr, "\nSampling rate mismatch: %d Hz requested, but %d Hz found in file %s\n", args.sampleRate, inFileSampleRate, args.inputFilePath );
                exit( -1 );
                goto cleanup;
            }
            }
            break;
            break;
        case IVAS_ERR_SAMPLING_RATE_UNKNOWN: /* Returned when input is raw PCM */
        case IVAS_ERR_SAMPLING_RATE_UNKNOWN: /* Returned when input is raw PCM */
            if ( args.sampleRate == 0 )
            if ( args.sampleRate == 0 )
            {
            {
                fprintf( stderr, "Sampling rate must be specified on command line when using raw PCM input\n" );
                fprintf( stderr, "\nSampling rate must be specified on command line when using raw PCM input\n" );
                exit( -1 );
                goto cleanup;
            }
            }
            break;
            break;
        default:
        default:
            fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
            fprintf( stderr, "\nError: %s\n", ivas_error_to_string( error ) );
            exit( -1 );
            goto cleanup;
    }
    }


    int16_t inFileNumChannels = 0;
    int16_t inFileNumChannels = 0;
@@ -850,8 +850,8 @@ int main(
        error = AudioFileReader_getNumChannels( audioReader, &inFileNumChannels );
        error = AudioFileReader_getNumChannels( audioReader, &inFileNumChannels );
        if ( error != IVAS_ERR_OK && error != IVAS_ERR_NUM_CHANNELS_UNKNOWN )
        if ( error != IVAS_ERR_OK && error != IVAS_ERR_NUM_CHANNELS_UNKNOWN )
        {
        {
            fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
            fprintf( stderr, "\nAudioFileReader_getNumChannels failed: %s\n", ivas_error_to_string( error ) );
            exit( -1 );
            goto cleanup;
        }
        }
    }
    }


@@ -863,8 +863,8 @@ int main(
    args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_BINAURAL;
    args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_BINAURAL;
    if ( ( error = ISAR_POST_REND_open( &hIsarPostRend, args.sampleRate, args.outConfig.audioConfig, true, 0, 0.0, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
    if ( ( error = ISAR_POST_REND_open( &hIsarPostRend, args.sampleRate, args.outConfig.audioConfig, true, 0, 0.0, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
    {
    {
        fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) );
        fprintf( stderr, "\nError opening renderer handle: %s\n", ivas_error_to_string( error ) );
        exit( -1 );
        goto cleanup;
    }
    }


    /*------------------------------------------------------------------------------------------*
    /*------------------------------------------------------------------------------------------*
@@ -873,8 +873,8 @@ int main(


    if ( ( error = ISAR_POST_REND_InitConfig( hIsarPostRend, args.outConfig.audioConfig ) ) != IVAS_ERR_OK )
    if ( ( error = ISAR_POST_REND_InitConfig( hIsarPostRend, args.outConfig.audioConfig ) ) != IVAS_ERR_OK )
    {
    {
        fprintf( stderr, "Error in Renderer Config Init: %s\n", ivas_error_to_string( error ) );
        fprintf( stderr, "\nError in Renderer Config Init: %s\n", ivas_error_to_string( error ) );
        exit( -1 );
        goto cleanup;
    }
    }


    if ( args.inConfig.numBinBuses > 0 )
    if ( args.inConfig.numBinBuses > 0 )
@@ -886,8 +886,8 @@ int main(
                                                              bitsBuffer.config.isar_frame_size_ms,
                                                              bitsBuffer.config.isar_frame_size_ms,
                                                              bitsBuffer.config.lc3plusHighRes ) ) != IVAS_ERR_OK )
                                                              bitsBuffer.config.lc3plusHighRes ) ) != IVAS_ERR_OK )
        {
        {
            fprintf( stderr, "Error in getting split renderer bitstream header: %s\n", ivas_error_to_string( error ) );
            fprintf( stderr, "\nError in getting split renderer bitstream header: %s\n", ivas_error_to_string( error ) );
            exit( -1 );
            goto cleanup;
        }
        }
    }
    }


@@ -901,23 +901,23 @@ int main(
    {
    {
        if ( ( error = ISAR_POST_REND_AddInput( hIsarPostRend, args.inConfig.binBuses[i].audioConfig, &splitBinIds[i] ) ) != IVAS_ERR_OK )
        if ( ( error = ISAR_POST_REND_AddInput( hIsarPostRend, args.inConfig.binBuses[i].audioConfig, &splitBinIds[i] ) ) != IVAS_ERR_OK )
        {
        {
            fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
            fprintf( stderr, "\nISAR_POST_REND_AddInput failed: %s\n", ivas_error_to_string( error ) );
            exit( -1 );
            goto cleanup;
        }
        }
    }
    }


    const int16_t totalNumInChannels = getTotalNumInChannels( hIsarPostRend, splitBinIds );
    const int16_t totalNumInChannels = getTotalNumInChannels( hIsarPostRend, splitBinIds );
    if ( inFileNumChannels != 0 /* inFileNumChannels is 0 with raw PCM input */ && totalNumInChannels != inFileNumChannels )
    if ( inFileNumChannels != 0 /* inFileNumChannels is 0 with raw PCM input */ && totalNumInChannels != inFileNumChannels )
    {
    {
        fprintf( stderr, "Number of channels in input file does not match selected configuration\n" );
        fprintf( stderr, "\nNumber of channels in input file does not match selected configuration\n" );
        exit( -1 );
        goto cleanup;
    }
    }


    int16_t numOutChannels = 2;
    int16_t numOutChannels = 2;
    if ( AudioFileWriter_open( &audioWriter, args.outputFilePath, args.sampleRate, numOutChannels ) != IVAS_ERR_OK )
    if ( AudioFileWriter_open( &audioWriter, args.outputFilePath, args.sampleRate, numOutChannels ) != IVAS_ERR_OK )
    {
    {
        fprintf( stderr, "Failed to open file: %s\n", args.outputFilePath );
        fprintf( stderr, "\nFailed to open file: %s\n", args.outputFilePath );
        exit( -1 );
        goto cleanup;
    }
    }


    /*------------------------------------------------------------------------------------------*
    /*------------------------------------------------------------------------------------------*
@@ -985,6 +985,9 @@ int main(


    while ( 1 )
    while ( 1 )
    {
    {
#ifdef NONBE_1293_CRASH_FIRST_FRAME_LOST
        int16_t bfi = 0;
#endif
        int16_t num_in_channels;
        int16_t num_in_channels;
        num_in_channels = inBuffer.config.numChannels;
        num_in_channels = inBuffer.config.numChannels;


@@ -993,7 +996,11 @@ int main(
        {
        {
            ivas_error error_tmp;
            ivas_error error_tmp;
            numSamplesRead = (int16_t) inBufferSize;
            numSamplesRead = (int16_t) inBufferSize;
#ifdef NONBE_1293_CRASH_FIRST_FRAME_LOST
            error_tmp = split_rend_read_bits_from_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten, &bfi );
#else
            error_tmp = split_rend_read_bits_from_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten );
            error_tmp = split_rend_read_bits_from_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten );
#endif
            if ( error_tmp != IVAS_ERR_OK )
            if ( error_tmp != IVAS_ERR_OK )
            {
            {
                if ( error_tmp == IVAS_ERR_END_OF_FILE )
                if ( error_tmp == IVAS_ERR_END_OF_FILE )
@@ -1003,7 +1010,7 @@ int main(
                else
                else
                {
                {
                    fprintf( stderr, "\nUnable to read from bitstream file!\n" );
                    fprintf( stderr, "\nUnable to read from bitstream file!\n" );
                    exit( -1 );
                    goto cleanup;
                }
                }
            }
            }
        }
        }
@@ -1014,7 +1021,7 @@ int main(
            if ( ( error = AudioFileReader_read( audioReader, inpInt16Buffer, (int16_t) inBufferSize, &numSamplesRead ) ) != IVAS_ERR_OK )
            if ( ( error = AudioFileReader_read( audioReader, inpInt16Buffer, (int16_t) inBufferSize, &numSamplesRead ) ) != IVAS_ERR_OK )
            {
            {
                fprintf( stderr, "\nError reading from file %s\n", audioFilePath );
                fprintf( stderr, "\nError reading from file %s\n", audioFilePath );
                exit( -1 );
                goto cleanup;
            }
            }
        }
        }


@@ -1040,39 +1047,53 @@ int main(


                if ( ( error = HeadRotationFileReading( headRotReader, &headRot, &Pos ) ) != IVAS_ERR_OK )
                if ( ( error = HeadRotationFileReading( headRotReader, &headRot, &Pos ) ) != IVAS_ERR_OK )
                {
                {
                    fprintf( stderr, "Error in Head Rotation File Reading: %s\n", ivas_error_to_string( error ) );
                    fprintf( stderr, "\nError in Head Rotation File Reading: %s\n", ivas_error_to_string( error ) );
                    exit( -1 );
                    goto cleanup;
                }
                }


                if ( ( error = ISAR_POST_REND_SetHeadRotation( hIsarPostRend, headRot, Pos, DEFAULT_AXIS, sf_idx ) ) != IVAS_ERR_OK )
                if ( ( error = ISAR_POST_REND_SetHeadRotation( hIsarPostRend, headRot, Pos, DEFAULT_AXIS, sf_idx ) ) != IVAS_ERR_OK )
                {
                {
                    fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) );
                    fprintf( stderr, "\nError setting Head Rotation: %s\n", ivas_error_to_string( error ) );
                    exit( -1 );
                    goto cleanup;
                }
                }
            }
            }
        }
        }
        else
        else
        {
        {
            fprintf( stderr, "Head Rotation should be enabled in post renderer\n" );
            fprintf( stderr, "\nHead Rotation should be enabled in post renderer\n" );
            exit( -1 );
            goto cleanup;
        }
        }


        /* Read from split renderer bfi file if specified */
        /* Read from split renderer bfi file if specified */
        if ( splitRendBFIReader != NULL && splitBinNeedsNewFrame )
        if ( splitRendBFIReader != NULL && splitBinNeedsNewFrame )
        {
        {
#ifndef NONBE_1293_CRASH_FIRST_FRAME_LOST
            int16_t bfi;
            int16_t bfi;
#endif
            if ( ( error = SplitRendBFIFileReading( splitRendBFIReader, &bfi ) ) != IVAS_ERR_OK )
            if ( ( error = SplitRendBFIFileReading( splitRendBFIReader, &bfi ) ) != IVAS_ERR_OK )
            {
            {
                fprintf( stderr, "Error in SplitRendBFIFileReading(): %s\n", ivas_error_to_string( error ) );
                fprintf( stderr, "\nError in SplitRendBFIFileReading(): %s\n", ivas_error_to_string( error ) );
                exit( -1 );
                goto cleanup;
            }
            }


#ifndef NONBE_1293_CRASH_FIRST_FRAME_LOST
            if ( ( error = ISAR_POST_REND_SetSplitRendBFI( hIsarPostRend, bfi ) ) != IVAS_ERR_OK )
            if ( ( error = ISAR_POST_REND_SetSplitRendBFI( hIsarPostRend, bfi ) ) != IVAS_ERR_OK )
            {
            {
                fprintf( stderr, "Error in ISAR_POST_REND_SetSplitRendBFI(): %s\n", ivas_error_to_string( error ) );
                fprintf( stderr, "Error in ISAR_POST_REND_SetSplitRendBFI(): %s\n", ivas_error_to_string( error ) );
                exit( -1 );
                exit( -1 );
            }
            }
#endif
        }
#ifdef NONBE_1293_CRASH_FIRST_FRAME_LOST
        if ( splitBinNeedsNewFrame )
        {
            if ( ( error = ISAR_POST_REND_SetSplitRendBFI( hIsarPostRend, bfi ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nError in ISAR_POST_REND_SetSplitRendBFI(): %s\n", ivas_error_to_string( error ) );
                goto cleanup;
            }
        }
        }
#endif


        for ( i = 0; i < args.inConfig.numBinBuses; ++i )
        for ( i = 0; i < args.inConfig.numBinBuses; ++i )
        {
        {
@@ -1080,31 +1101,31 @@ int main(
            {
            {
                if ( ( error = ISAR_POST_REND_GetInputNumChannels( hIsarPostRend, splitBinIds[i], &numChannels ) ) != IVAS_ERR_OK )
                if ( ( error = ISAR_POST_REND_GetInputNumChannels( hIsarPostRend, splitBinIds[i], &numChannels ) ) != IVAS_ERR_OK )
                {
                {
                    fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
                    fprintf( stderr, "\nISAR_POST_REND_GetInputNumChannels failed: %s\n", ivas_error_to_string( error ) );
                    exit( -1 );
                    goto cleanup;
                }
                }
                ISAR_POST_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer, (int16_t) args.inConfig.binBuses[i].inputChannelIndex, numChannels );
                ISAR_POST_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer, (int16_t) args.inConfig.binBuses[i].inputChannelIndex, numChannels );


                if ( ( error = ISAR_POST_REND_FeedInputAudio( hIsarPostRend, splitBinIds[i], tmpBuffer ) ) != IVAS_ERR_OK )
                if ( ( error = ISAR_POST_REND_FeedInputAudio( hIsarPostRend, splitBinIds[i], tmpBuffer ) ) != IVAS_ERR_OK )
                {
                {
                    fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
                    fprintf( stderr, "\nISAR_POST_REND_FeedInputAudio failed: %s\n", ivas_error_to_string( error ) );
                    exit( -1 );
                    goto cleanup;
                }
                }
            }
            }
            if ( splitBinNeedsNewFrame )
            if ( splitBinNeedsNewFrame )
            {
            {
                if ( ( error = ISAR_POST_REND_FeedSplitBinauralBitstream( hIsarPostRend, splitBinIds[i], &bitsBuffer ) ) != IVAS_ERR_OK )
                if ( ( error = ISAR_POST_REND_FeedSplitBinauralBitstream( hIsarPostRend, splitBinIds[i], &bitsBuffer ) ) != IVAS_ERR_OK )
                {
                {
                    fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
                    fprintf( stderr, "\nISAR_POST_REND_FeedSplitBinauralBitstream failed: %s\n", ivas_error_to_string( error ) );
                    exit( -1 );
                    goto cleanup;
                }
                }
            }
            }
        }
        }


        if ( ( error = ISAR_POST_REND_GetSplitBinauralSamples( hIsarPostRend, outBuffer, &splitBinNeedsNewFrame ) ) != IVAS_ERR_OK )
        if ( ( error = ISAR_POST_REND_GetSplitBinauralSamples( hIsarPostRend, outBuffer, &splitBinNeedsNewFrame ) ) != IVAS_ERR_OK )
        {
        {
            fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
            fprintf( stderr, "\nISAR_POST_REND_GetSplitBinauralSamples failed: %s\n", ivas_error_to_string( error ) );
            exit( -1 );
            goto cleanup;
        }
        }


        int16_t num_out_channels;
        int16_t num_out_channels;
@@ -1121,7 +1142,7 @@ int main(
                if ( ISAR_POST_REND_GetDelay( hIsarPostRend, &delayNumSamples, &delayTimeScale ) != IVAS_ERR_OK )
                if ( ISAR_POST_REND_GetDelay( hIsarPostRend, &delayNumSamples, &delayTimeScale ) != IVAS_ERR_OK )
                {
                {
                    fprintf( stderr, "\nUnable to get delay of renderer!\n" );
                    fprintf( stderr, "\nUnable to get delay of renderer!\n" );
                    exit( -1 );
                    goto cleanup;
                }
                }


                if ( hSplitRendFileReadWrite != NULL )
                if ( hSplitRendFileReadWrite != NULL )
@@ -1146,8 +1167,8 @@ int main(
            {
            {
                if ( AudioFileWriter_write( audioWriter, &outInt16Buffer[delayNumSamples * num_out_channels], outBufferSize - ( delayNumSamples * num_out_channels ) ) != IVAS_ERR_OK )
                if ( AudioFileWriter_write( audioWriter, &outInt16Buffer[delayNumSamples * num_out_channels], outBufferSize - ( delayNumSamples * num_out_channels ) ) != IVAS_ERR_OK )
                {
                {
                    fprintf( stderr, "Error writing audio file %s\n", args.outputFilePath );
                    fprintf( stderr, "\nError writing audio file %s\n", args.outputFilePath );
                    exit( -1 );
                    goto cleanup;
                }
                }
                delayNumSamples = 0;
                delayNumSamples = 0;
            }
            }
@@ -1181,7 +1202,7 @@ int main(
            if ( ( error = AudioFileWriter_write( audioWriter, outInt16Buffer, outBufferSize ) ) != IVAS_ERR_OK )
            if ( ( error = AudioFileWriter_write( audioWriter, outInt16Buffer, outBufferSize ) ) != IVAS_ERR_OK )
            {
            {
                fprintf( stderr, "\nOutput audio file writer error\n" );
                fprintf( stderr, "\nOutput audio file writer error\n" );
                exit( -1 );
                goto cleanup;
            }
            }
        }
        }


@@ -1189,7 +1210,7 @@ int main(
        if ( ( error = AudioFileWriter_write( audioWriter, outInt16Buffer, zeroPadToWrite * outBuffer.config.numChannels ) ) != IVAS_ERR_OK )
        if ( ( error = AudioFileWriter_write( audioWriter, outInt16Buffer, zeroPadToWrite * outBuffer.config.numChannels ) ) != IVAS_ERR_OK )
        {
        {
            fprintf( stderr, "\nOutput audio file writer error\n" );
            fprintf( stderr, "\nOutput audio file writer error\n" );
            exit( -1 );
            goto cleanup;
        }
        }
        zeroPadToWrite = 0;
        zeroPadToWrite = 0;
    }
    }
@@ -1217,6 +1238,8 @@ int main(
     * Close files and deallocate resources
     * Close files and deallocate resources
     *------------------------------------------------------------------------------------------*/
     *------------------------------------------------------------------------------------------*/


cleanup:

    free( inpInt16Buffer );
    free( inpInt16Buffer );
    free( inFloatBuffer );
    free( inFloatBuffer );
    free( outInt16Buffer );
    free( outInt16Buffer );
+174 −171

File changed.

Preview size limit exceeded, changes collapsed.

Loading