Commit 6f9e6227 authored by Vladimir Malenovsky's avatar Vladimir Malenovsky
Browse files

improve error messages

parent 5ab7084b
Loading
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -1052,13 +1052,13 @@ int main(
                                        &bitsBuffer.config.lc3plusHighRes );
        if ( error != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nCould not open split rend metadata file %s\n", args.inMetadataFilePaths[0] );
            fprintf( stderr, "\nError: Could not open split rendering metadata file %s!\n", args.inMetadataFilePaths[0] );
            goto cleanup;
        }

        if ( AudioFileReader_open( &audioReader, audioFilePath ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError opening file: %s\n", audioFilePath );
            fprintf( stderr, "\nError: Could not open input file: %s!\n", audioFilePath );
            goto cleanup;
        }
    }
@@ -1077,7 +1077,7 @@ int main(
                                   &bitsBuffer.config.lc3plusHighRes );
        if ( error != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nCould not open split rend params file %s\n", args.srParamsFilePath );
            fprintf( stderr, "\nError: Could not open split rendering init params file %s!\n", args.srParamsFilePath );
            goto cleanup;
        }

@@ -1087,7 +1087,7 @@ int main(
        if ( ( error = IVAS_RTP_READER_Init( &srRTP, args.inputFilePath, NULL, false, NULL ) ) != IVAS_ERR_OK )
#endif
        {
            fprintf( stderr, "error in IVAS_RTP_READER_Init(): %d\n", error );
            fprintf( stderr, "\nError in IVAS_RTP_READER_Init(): %d!\n", error );
            goto cleanup;
        }
        audioReader = NULL;
@@ -1113,7 +1113,7 @@ int main(
                                        &bitsBuffer.config.lc3plusHighRes );
        if ( error != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nCould not open split rend metadata file %s\n", args.inputFilePath );
            fprintf( stderr, "\nError reading input file %s, error code: %d!\n", args.inputFilePath, error );
            goto cleanup;
        }
        audioReader = NULL;
@@ -1139,14 +1139,14 @@ int main(
            /* else if sampling rate given on command line, compare with wav file */
            else if ( inFileSampleRate != args.sampleRate )
            {
                fprintf( stderr, "\nSampling rate mismatch: %d Hz requested, but %d Hz found in file %s\n", args.sampleRate, inFileSampleRate, args.inputFilePath );
                fprintf( stderr, "\nError: Sampling rate mismatch: %d Hz requested, but %d Hz found in file %s!\n", args.sampleRate, inFileSampleRate, args.inputFilePath );
                goto cleanup;
            }
            break;
        case IVAS_ERR_SAMPLING_RATE_UNKNOWN: /* Returned when input is raw PCM */
            if ( args.sampleRate == 0 )
            {
                fprintf( stderr, "\nSampling rate must be specified on command line when using raw PCM input\n" );
                fprintf( stderr, "\nError: Sampling rate must be specified on command line in case of BINAURAL_SPLIT_PCM input!\n" );
                goto cleanup;
            }
            break;
@@ -1161,7 +1161,7 @@ int main(
        error = AudioFileReader_getNumChannels( audioReader, &inFileNumChannels );
        if ( error != IVAS_ERR_OK && error != IVAS_ERR_NUM_CHANNELS_UNKNOWN )
        {
            fprintf( stderr, "\nAudioFileReader_getNumChannels failed: %s\n", ivas_error_to_string( error ) );
            fprintf( stderr, "\nError: AudioFileReader_getNumChannels() failed: %s\n", ivas_error_to_string( error ) );
            goto cleanup;
        }
    }
+1 −1
Original line number Diff line number Diff line
@@ -1474,7 +1474,7 @@ int main(

        if ( ( error = split_rend_writer_open( &hSplitRendFileReadWrite, outFile, delayNumSamples_temp, delayTimeScale_temp, bitsBuffer.config.codec, bitsBuffer.config.poseCorrection, bitsBuffer.config.codec_frame_size_ms, bitsBuffer.config.isar_frame_size_ms, args.sampleRate, bitsBuffer.config.lc3plus_highres ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nCould not open split rend metadata file %s\n", outFile );
            fprintf( stderr, "\nError: Could not open split rend metadata file %s!\n", outFile );
            goto cleanup;
        }
    }
+3 −3
Original line number Diff line number Diff line
@@ -76,13 +76,13 @@ ivas_error split_rend_reader_open(

    if ( ( hSplitRendFileReadWrite = (SplitFileReadWrite *) malloc( sizeof( SplitFileReadWrite ) ) ) == NULL )
    {
        return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for split rendering writer\n" ) );
        return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for split rendering reader\n" ) );
    }

    hSplitRendFileReadWrite->file = fopen( filename, "rb" );
    if ( hSplitRendFileReadWrite->file == NULL )
    {
        return ( IVAS_ERROR( IVAS_ERR_FAILED_FILE_READ, "\nCould not open split rend metadata file %s\n", filename ) );
        return ( IVAS_ERROR( IVAS_ERR_FAILED_FILE_READ, "\nCould not open file %s\n", filename ) );
    }

    header_len = strlen( header );
@@ -98,7 +98,7 @@ ivas_error split_rend_reader_open(

    if ( strncmp( header_read, header, header_len ) )
    {
        return ( IVAS_ERROR( IVAS_ERR_FAILED_FILE_READ, "\nError split rend bitstream main header mismatch\n" ) );
        return ( IVAS_ERROR( IVAS_ERR_FAILED_FILE_READ, "\nSplit rendering bitstream main header mismatch\n" ) );
    }

    fread( &hSplitRendFileReadWrite->delay_ns, sizeof( uint32_t ), 1, hSplitRendFileReadWrite->file );