Commit 4ca9d699 authored by Jan Brouwer's avatar Jan Brouwer
Browse files

Preserve binary reverb file path text case

parent f404d857
Loading
Loading
Loading
Loading
+26 −15
Original line number Diff line number Diff line
@@ -825,7 +825,11 @@ static int32_t errorHandler(
 * Verifies if the configuration parameters lie within acceptable limits
 *------------------------------------------------------------------------------------------*/

#ifdef CONTROL_METADATA_REVERB
ivas_error RenderConfigReader_checkValues(
#else
static ivas_error RenderConfigReader_checkValues(
#endif
    IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o  : Renderer configuration handle          */
)
{
@@ -1404,22 +1408,35 @@ ivas_error RenderConfigReader_read(
                    fprintf( stderr, "Reverb config: number of bands changed but configuration vectors missing\n" );
                }
            }
#ifdef DEBUGGING
            else if ( strcmp( chapter, "GENERAL" ) == 0 && strlen( pParams ) != 0 )
#endif
#else
#ifdef DEBUGGING
            if ( strcmp( chapter, "GENERAL" ) == 0 && strlen( pParams ) != 0 )
#endif
#endif
#ifdef DEBUGGING
            {
                params_idx = 0;
                pValue = (char *) calloc( strlen( pParams ), sizeof( char ) );
                while ( sscanf( pParams + params_idx, "%64[^=]=%[^;];", item, pValue ) == 2 )
                {
#ifndef CONTROL_METADATA_REVERB
                    params_idx += ( int32_t )( strlen( item ) + strlen( pValue ) + 2 );
#endif
#ifdef DEBUGGING
                    fprintf( stderr, "        PARAM: %s -> %s\n", item, pValue );
#endif
#ifdef CONTROL_METADATA_REVERB
                    if ( strcmp( item, "REVERBFILE" ) == 0 )
                    {
                        /* get correct case file path */
                        sscanf( pTemp + params_idx, "%*[^=] = %[^;];", pValue );
                        if ( ( error = RenderConfigReader_readReverb(pValue, pRenderConfigReader) ) != IVAS_ERR_OK)
                        {
                            printf( "RenderConfigReader_readReverb(%s) returned %d\n", pValue, error );
                            errorHandler( item, error );
                        }
                    }
                    else
#endif
#ifdef DEBUGGING
                    if ( strcmp( item, "RENDERER" ) == 0 )
                    {
                        if ( strcmp( pValue, "CREND" ) == 0 )
@@ -1442,25 +1459,19 @@ ivas_error RenderConfigReader_read(
                            errorHandler( item, ERROR_VALUE_INVALID );
                        }
                    }
                    if ( strcmp( item, "REVERBFILE" ) == 0 )
                    {
                        // TODO: need to preserve file name case for non Windows OSes
                        if ( ( error = RenderConfigReader_readReverb(pValue, pRenderConfigReader) ) != IVAS_ERR_OK)
                        {
                            printf( "RenderConfigReader_readReverb(%s) returned %d\n", pValue, error );
                            errorHandler( item, error );
                        }
                    }
#ifdef DEBUGGING
                    else
                    {
                        fprintf( stderr, "Unsupported configuration property %s\n", item );
                    }
#endif
#endif
#ifdef CONTROL_METADATA_REVERB
                    params_idx += (int32_t) ( strlen( item ) + strlen( pValue ) + 2 );
#endif
                }
                free( pValue );
            }
#endif
            else
            {
                fprintf( stderr, "Unknown chapter: %s\n", chapter );