aboutsummaryrefslogtreecommitdiffstats
path: root/src/output_thread.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/output_thread.c
parent97b844ec72a415da962ee37d6f5b5e527ded13d3 (diff)
downloadmpd-7f34e9410eeb638b44ba1c7f7711844bd410b3a7.tar.gz
mpd-7f34e9410eeb638b44ba1c7f7711844bd410b3a7.tar.xz
mpd-7f34e9410eeb638b44ba1c7f7711844bd410b3a7.zip
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/output_thread.c')
-rw-r--r--src/output_thread.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/output_thread.c b/src/output_thread.c
index 63c443ddc..1467d26a8 100644
--- a/src/output_thread.c
+++ b/src/output_thread.c
@@ -84,6 +84,7 @@ static void ao_play(struct audio_output *ao)
if (!ret) {
ao->plugin->cancel(ao->data);
ao->plugin->close(ao->data);
+ pcm_convert_deinit(&ao->convState);
ao->open = false;
}
@@ -118,6 +119,8 @@ static gpointer audio_output_task(gpointer arg)
case AO_COMMAND_OPEN:
assert(!ao->open);
+
+ pcm_convert_init(&ao->convState);
ret = ao->plugin->open(ao->data,
&ao->outAudioFormat);
@@ -134,6 +137,7 @@ static gpointer audio_output_task(gpointer arg)
assert(ao->open);
ao->plugin->cancel(ao->data);
ao->plugin->close(ao->data);
+
ao->open = false;
ao_command_finished(ao);
break;