diff --git a/apps/decoder.c b/apps/decoder.c index cb81edc24be6893e626bedca2d4d8e9e15b4b781..968dc79ec2b69bcff8bc225c0203931c3f9ccb9f 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -427,25 +427,25 @@ int main( /* sanity check */ if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM ) { - fprintf( stderr, "\nExternal Renderer Config is supported only when BINAURAL_ROOM is used as output. Exiting. \n" ); + fprintf( stderr, "\nExternal Renderer Config is supported only when BINAURAL_ROOM is used as output. Exiting. \n\n" ); goto cleanup; } if ( ( error = IVAS_DEC_GetRenderConfig( hIvasDec, &renderConfig ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nIVAS_DEC_GetRenderConfig failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + fprintf( stderr, "\nIVAS_DEC_GetRenderConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } if ( RenderConfigReader_read( renderConfigReader, &renderConfig ) != IVAS_ERR_OK ) { - fprintf( stderr, "Failed to read renderer configuration from file %s\n", arg.renderConfigFilename ); + fprintf( stderr, "Failed to read renderer configuration from file %s\n\n", arg.renderConfigFilename ); goto cleanup; } if ( ( error = IVAS_DEC_FeedRenderConfig( hIvasDec, renderConfig ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nIVAS_DEC_FeedRenderConfig failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + fprintf( stderr, "\nIVAS_DEC_FeedRenderConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } } diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 2d4194556359110ba2ce16f924e5b091dd2ef029..f4566b4c50dda38fe749405b45f9a0a283ee5d43 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -250,9 +250,20 @@ void IVAS_DEC_Close( if ( ( *phIvasDec )->hVoIP ) { IVAS_DEC_Close_VoIP( ( *phIvasDec )->hVoIP ); +#ifdef FIX_I98_HANDLES_TO_NULL + ( *phIvasDec )->hVoIP = NULL; +#else count_free( ( *phIvasDec )->hVoIP ); +#endif } +#ifdef FIX_I98_HANDLES_TO_NULL + if ( ( *phIvasDec )->st_ivas ) + { + ivas_destroy_dec( ( *phIvasDec )->st_ivas ); + ( *phIvasDec )->st_ivas = NULL; + } +#else if ( ( *phIvasDec )->isInitialized ) { if ( ( *phIvasDec )->st_ivas ) @@ -268,7 +279,7 @@ void IVAS_DEC_Close( ( *phIvasDec )->st_ivas->hDecoderConfig = NULL; } -#ifndef FIX_I98_HANDLES_TO_NULL + if ( ( *phIvasDec )->st_ivas->hHeadTrackData != NULL ) { count_free( ( *phIvasDec )->st_ivas->hHeadTrackData ); @@ -278,11 +289,11 @@ void IVAS_DEC_Close( ivas_render_config_close( &( ( *phIvasDec )->st_ivas->hRenderConfig ) ); ivas_HRTF_binary_close( &( *phIvasDec )->st_ivas->hHrtfTD ); -#endif count_free( ( *phIvasDec )->st_ivas ); } ( *phIvasDec )->st_ivas = NULL; +#endif count_free( *phIvasDec ); *phIvasDec = NULL; @@ -1489,6 +1500,10 @@ static void IVAS_DEC_Close_VoIP( pcmdsp_fifo_destroy( &hVoIP->hFifoAfterTimeScaler ); +#ifdef FIX_I98_HANDLES_TO_NULL + count_free( hVoIP ); +#endif + return; }