Commit 2f01d8b5 authored by Marek Szczerba's avatar Marek Szczerba
Browse files

Fix for memory leak in HRTF statistics. Minor HRTF statistics functions refactoring

parent 5158a2af
Loading
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -1004,10 +1004,6 @@ cleanup:
#endif
        IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF );
        destroy_SetOfHRTF( hSetOfHRTF );
#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
        IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics );
        destroy_hrtf_statistics( hHrtfStatistics );
#endif
    }

    IVAS_DEC_Close( &hIvasDec );
+5 −0
Original line number Diff line number Diff line
@@ -2747,6 +2747,11 @@ void ivas_destroy_dec(
    /* Parametric binauralizer HRTF filters */
    ivas_HRTF_parambin_binary_close( &st_ivas->hHrtfParambin );

#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
    /* HRTF statistics */
    ivas_HRTF_statistics_close( &st_ivas->hHrtfStatistics );
#endif

    /* Config. Renderer */
    ivas_render_config_close( &( st_ivas->hRenderConfig ) );

+2 −2
Original line number Diff line number Diff line
@@ -239,12 +239,12 @@ ivas_error ivas_HRTF_statistics_binary_open(


/*-----------------------------------------------------------------------*
 * ivas_HRTF_statistics_binary_close()
 * ivas_HRTF_statistics_close()
 *
 * Close HRTF binary handle for statistics handler
 *-----------------------------------------------------------------------*/

void ivas_HRTF_statistics_binary_close(
void ivas_HRTF_statistics_close(
    HRTFS_STATISTICS **hHrtfStatistics )
{
    if ( hHrtfStatistics == NULL || *hHrtfStatistics == NULL )
+12 −11
Original line number Diff line number Diff line
@@ -608,28 +608,29 @@ void ivas_HRTF_parambin_binary_close(
    HRTFS_PARAMBIN **hHrtfParambin                              /* i/o: Parametric binauralizer HRTF structure  */
);

#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
ivas_error ivas_HRTF_statistics_binary_open(
    HRTFS_STATISTICS **hHrtfStatistics
ivas_error ivas_HRTF_CRend_binary_open(
    HRTFS_CREND **hSetOfHRTF                                    /* i/o: Set of HRTF handle                      */
);

void ivas_HRTF_statistics_binary_close(
    HRTFS_STATISTICS **hHrtfStatistics                          /* i/o: HRTF statistics structure               */
void ivas_HRTF_CRend_binary_close(
    HRTFS_CREND **hSetOfHRTF                                    /* i/o: Set of HRTF handle                      */
);

#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
ivas_error ivas_HRTF_statistics_init(
    HRTFS_STATISTICS_HANDLE *hHrtfStatistics,                   /* i/o: HRTF statistics structure               */
    int32_t sampleRate );                                       /* i  : Sample rate                             */
#endif
    int32_t sampleRate                                          /* i  : Sample rate                             */
);

ivas_error ivas_HRTF_CRend_binary_open(
    HRTFS_CREND **hSetOfHRTF                                    /* i/o: Set of HRTF handle                      */
void ivas_HRTF_statistics_close(
    HRTFS_STATISTICS **hHrtfStatistics                          /* i/o: HRTF statistics structure               */
);

void ivas_HRTF_CRend_binary_close(
    HRTFS_CREND **hSetOfHRTF                                    /* i/o: Set of HRTF handle                      */
ivas_error ivas_HRTF_statistics_binary_open(
    HRTFS_STATISTICS **hHrtfStatistics                          /* i/o: HRTF statistics structure               */
);

#endif

/*----------------------------------------------------------------------------------*
 * TD object renderer
+1 −1
Original line number Diff line number Diff line
@@ -8795,7 +8795,7 @@ void IVAS_REND_Close(
    ivas_HRTF_fastconv_binary_close( &( hIvasRend->hHrtfs.hHrtfFastConv ) );
    ivas_HRTF_parambin_binary_close( &( hIvasRend->hHrtfs.hHrtfParambin ) );
#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES
    ivas_HRTF_statistics_binary_close( &( hIvasRend->hHrtfs.hHrtfStatistics ) );
    ivas_HRTF_statistics_close( &( hIvasRend->hHrtfs.hHrtfStatistics ) );
#endif
#endif

Loading