Commit b87395d1 authored by Shikha Shetgeri's avatar Shikha Shetgeri
Browse files

smoke-test fix

parent b0e79d25
Loading
Loading
Loading
Loading
Loading
+24 −3
Original line number Diff line number Diff line
@@ -1531,7 +1531,22 @@ ivas_error load_fastconv_HRTF_from_binary(
            free( hrtf_data );
            return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "HRTF binary file not compliant (number of HRTF)" );
        }

#ifdef FIX_1720_HRTF_FASTCONV
        if ( ( hrtf_header.rend_type == RENDERER_BINAURAL_FASTCONV ) || ( hrtf_header.rend_type == RENDERER_BINAURAL_FASTCONV_ROOM ) )
        {
            if ( fread( hrtf_data, 1, hrtf_header.data_size, f_hrtf ) != hrtf_header.data_size )
            {
                free( hrtf_data );
                return IVAS_ERROR( IVAS_ERR_FAILED_FILE_READ, "Error in HRTF file reading" );
            }
            /* Create the HRTF reading the raw data from the binary file */
            if ( ( create_fastconv_HRTF_from_rawdata( &hHrtfFastConv, hrtf_data, hrtf_header.rend_type, hrtf_header.input_cfg ) ) != IVAS_ERR_OK )
            {
                free( hrtf_data );
                return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Could not create HRTF from binary file" );
            }
        }
#else
        if ( ( hrtf_header.frequency == 48000 ) &&
             ( ( hrtf_header.rend_type == RENDERER_BINAURAL_FASTCONV ) || ( hrtf_header.rend_type == RENDERER_BINAURAL_FASTCONV_ROOM ) ) )
        {
@@ -1547,6 +1562,7 @@ ivas_error load_fastconv_HRTF_from_binary(
                return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Could not create HRTF from binary file" );
            }
        }
#endif
        else
        {
            fseek( f_hrtf, hrtf_header.data_size, SEEK_CUR );
@@ -1806,13 +1822,18 @@ ivas_error create_SetOfHRTF_from_binary(
    }

    free( hrtf_data );

    if ( ( ( *hSetOfHRTF ).hHRTF_hrir_combined == NULL ) || ( ( *hSetOfHRTF ).hHRTF_brir_combined == NULL ) || ( ( *hSetOfHRTF ).hHRTF_hrir_hoa3 == NULL ) )
    {
#ifdef FIX_1720_HRTF_FASTCONV
        if ( destroy_SetOfHRTF( hSetOfHRTF ) != IVAS_ERR_OK )
        {
            return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Could not create all the HRTF from binary file" );
        }
#else
        destroy_SetOfHRTF( hSetOfHRTF );
        return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Could not create all the HRTF from binary file" );
#endif
    }

    return IVAS_ERR_OK;
}