From 7f34e9410eeb638b44ba1c7f7711844bd410b3a7 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 7 Jan 2009 22:20:30 +0100 Subject: pcm: added pcm_convert_deinit(), pcm_resample_deinit() Free memory allocated by libsamplerate when the output or the decoder is closed. --- src/pcm_resample_libsamplerate.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/pcm_resample_libsamplerate.c') diff --git a/src/pcm_resample_libsamplerate.c b/src/pcm_resample_libsamplerate.c index 95d7e5d7f..ff7a7f95f 100644 --- a/src/pcm_resample_libsamplerate.c +++ b/src/pcm_resample_libsamplerate.c @@ -29,6 +29,13 @@ #undef G_LOG_DOMAIN #define G_LOG_DOMAIN "pcm" +void pcm_resample_deinit(G_GNUC_UNUSED struct pcm_resample_state *state) +{ + if (state->state != NULL) + state->state = src_delete(state->state); + +} + static int pcm_resample_get_converter(void) { const char *conf = getConfigParamValue(CONF_SAMPLERATE_CONVERTER); -- cgit v1.2.3