aboutsummaryrefslogtreecommitdiff
path: root/src/pcm_resample_libsamplerate.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-07 22:20:30 +0100
committerMax Kellermann <max@duempel.org>2009-01-07 22:20:30 +0100
commit7f34e9410eeb638b44ba1c7f7711844bd410b3a7 (patch)
treeac6dfdc40ee3ad04733151ba396f153c719822cf /src/pcm_resample_libsamplerate.c
parent97b844ec72a415da962ee37d6f5b5e527ded13d3 (diff)
pcm: added pcm_convert_deinit(), pcm_resample_deinit()
Free memory allocated by libsamplerate when the output or the decoder is closed.
Diffstat (limited to 'src/pcm_resample_libsamplerate.c')
-rw-r--r--src/pcm_resample_libsamplerate.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/pcm_resample_libsamplerate.c b/src/pcm_resample_libsamplerate.c
index 95d7e5d7..ff7a7f95 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);