DespotifyUtils: return Tag, not pointer

This commit is contained in:
Max Kellermann
2014-01-08 19:21:48 +01:00
parent 89a78a5f3c
commit 2071070f39
4 changed files with 12 additions and 12 deletions

View File

@@ -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;
}