aboutsummaryrefslogtreecommitdiffstats
path: root/src/input/DespotifyInputPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-08 19:21:48 +0100
committerMax Kellermann <max@duempel.org>2014-01-08 19:49:27 +0100
commit2071070f39216accc02550102017e4f8abb9b5ea (patch)
tree0470aa32f02ff7b8ab27d77e015a93a0731c98e5 /src/input/DespotifyInputPlugin.cxx
parent89a78a5f3c4f648e9f20e83ac1d4769eff24c5b8 (diff)
downloadmpd-2071070f39216accc02550102017e4f8abb9b5ea.tar.gz
mpd-2071070f39216accc02550102017e4f8abb9b5ea.tar.xz
mpd-2071070f39216accc02550102017e4f8abb9b5ea.zip
DespotifyUtils: return Tag, not pointer
Diffstat (limited to 'src/input/DespotifyInputPlugin.cxx')
-rw-r--r--src/input/DespotifyInputPlugin.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/input/DespotifyInputPlugin.cxx b/src/input/DespotifyInputPlugin.cxx
index 787e0722e..18704bd40 100644
--- a/src/input/DespotifyInputPlugin.cxx
+++ b/src/input/DespotifyInputPlugin.cxx
@@ -41,7 +41,7 @@ class DespotifyInputStream {
struct despotify_session *session;
struct ds_track *track;
- Tag *tag;
+ Tag tag;
struct ds_pcm_data pcm;
size_t len_available;
bool eof;
@@ -64,8 +64,6 @@ class DespotifyInputStream {
public:
~DespotifyInputStream() {
- delete tag;
-
despotify_free_track(track);
}
@@ -79,8 +77,11 @@ public:
size_t Read(void *ptr, size_t size, Error &error);
Tag *ReadTag() {
- Tag *result = tag;
- tag = nullptr;
+ if (tag.IsEmpty())
+ return nullptr;
+
+ Tag *result = new Tag(std::move(tag));
+ tag.Clear();
return result;
}