aboutsummaryrefslogtreecommitdiffstats
path: root/src/DecoderInternal.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-04 22:02:52 +0100
committerMax Kellermann <max@duempel.org>2013-01-04 22:02:52 +0100
commit7267558ba1cba9338c78b41d11e2eadef6bb515b (patch)
tree3e351410fab0fbfeb367979d6af8dadace02145a /src/DecoderInternal.cxx
parentac6803e7b73b96573c7b6823e03bc153d1f63b8a (diff)
downloadmpd-7267558ba1cba9338c78b41d11e2eadef6bb515b.tar.gz
mpd-7267558ba1cba9338c78b41d11e2eadef6bb515b.tar.xz
mpd-7267558ba1cba9338c78b41d11e2eadef6bb515b.zip
DecoderThread: move code to destructor
Diffstat (limited to '')
-rw-r--r--src/DecoderInternal.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/DecoderInternal.cxx b/src/DecoderInternal.cxx
index d68f7856e..c5884d357 100644
--- a/src/DecoderInternal.cxx
+++ b/src/DecoderInternal.cxx
@@ -24,10 +24,31 @@
#include "MusicBuffer.hxx"
#include "MusicChunk.hxx"
+extern "C" {
+#include "tag.h"
+}
+
#include "input_stream.h"
#include <assert.h>
+decoder::~decoder()
+{
+ /* caller must flush the chunk */
+ assert(chunk == nullptr);
+
+ if (song_tag != nullptr)
+ tag_free(song_tag);
+
+ if (stream_tag != nullptr)
+ tag_free(stream_tag);
+
+ if (decoder_tag != nullptr)
+ tag_free(decoder_tag);
+
+ pcm_convert_deinit(&conv_state);
+}
+
/**
* All chunks are full of decoded data; wait for the player to free
* one.