aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder
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/decoder
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 '')
-rw-r--r--src/decoder_api.c2
-rw-r--r--src/decoder_thread.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/decoder_api.c b/src/decoder_api.c
index 76bf05754..63bb0f2f2 100644
--- a/src/decoder_api.c
+++ b/src/decoder_api.c
@@ -45,8 +45,6 @@ void decoder_initialized(struct decoder * decoder,
assert(audio_format_defined(audio_format));
assert(audio_format_valid(audio_format));
- pcm_convert_init(&decoder->conv_state);
-
dc.in_audio_format = *audio_format;
getOutputAudioFormat(audio_format, &dc.out_audio_format);
diff --git a/src/decoder_thread.c b/src/decoder_thread.c
index 2d2e50b39..12449237f 100644
--- a/src/decoder_thread.c
+++ b/src/decoder_thread.c
@@ -124,6 +124,8 @@ static void decoder_run_song(const struct song *song, const char *uri)
return;
}
+ pcm_convert_init(&decoder.conv_state);
+
ret = false;
if (!song_is_file(song)) {
unsigned int next = 0;
@@ -187,6 +189,8 @@ static void decoder_run_song(const struct song *song, const char *uri)
}
}
+ pcm_convert_deinit(&decoder.conv_state);
+
music_pipe_flush();
if (close_instream)