aboutsummaryrefslogtreecommitdiffstats
path: root/src/input/plugins/DespotifyInputPlugin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/input/plugins/DespotifyInputPlugin.cxx')
-rw-r--r--src/input/plugins/DespotifyInputPlugin.cxx20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/input/plugins/DespotifyInputPlugin.cxx b/src/input/plugins/DespotifyInputPlugin.cxx
index 16ef07f0d..86fbbbad3 100644
--- a/src/input/plugins/DespotifyInputPlugin.cxx
+++ b/src/input/plugins/DespotifyInputPlugin.cxx
@@ -61,9 +61,7 @@ class DespotifyInputStream final : public InputStream {
}
public:
- ~DespotifyInputStream() {
- despotify_free_track(track);
- }
+ ~DespotifyInputStream();
static InputStream *Open(const char *url, Mutex &mutex, Cond &cond,
Error &error);
@@ -146,6 +144,12 @@ static void callback(gcc_unused struct despotify_session* ds,
ctx->Callback(sig);
}
+DespotifyInputStream::~DespotifyInputStream()
+{
+ mpd_despotify_unregister_callback(callback);
+ despotify_free_track(track);
+}
+
inline InputStream *
DespotifyInputStream::Open(const char *url,
Mutex &mutex, Cond &cond,
@@ -220,15 +224,6 @@ input_despotify_read(InputStream *is, void *ptr, size_t size, Error &error)
return ctx->Read(ptr, size, error);
}
-static void
-input_despotify_close(InputStream *is)
-{
- DespotifyInputStream *ctx = (DespotifyInputStream *)is;
-
- mpd_despotify_unregister_callback(callback);
- delete ctx;
-}
-
static bool
input_despotify_eof(InputStream *is)
{
@@ -250,7 +245,6 @@ const InputPlugin input_plugin_despotify = {
nullptr,
nullptr,
input_despotify_open,
- input_despotify_close,
nullptr,
nullptr,
input_despotify_tag,