diff options
Diffstat (limited to 'src/input/CurlInputPlugin.cxx')
-rw-r--r-- | src/input/CurlInputPlugin.cxx | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/input/CurlInputPlugin.cxx b/src/input/CurlInputPlugin.cxx index b78545951..ccb73a448 100644 --- a/src/input/CurlInputPlugin.cxx +++ b/src/input/CurlInputPlugin.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2013 The Music Player Daemon Project + * Copyright (C) 2003-2014 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -24,6 +24,7 @@ #include "ConfigGlobal.hxx" #include "ConfigData.hxx" #include "tag/Tag.hxx" +#include "tag/TagBuilder.hxx" #include "IcyMetaDataParser.hxx" #include "event/SocketMonitor.hxx" #include "event/TimeoutMonitor.hxx" @@ -199,8 +200,6 @@ public: Abandon() would be most appropriate, but it breaks the second case - is that a CURL bug? is there a better solution? */ - - Steal(); } /** @@ -780,8 +779,11 @@ copy_icy_tag(struct input_curl *c) delete c->tag; - if (!c->meta_name.empty() && !tag->HasType(TAG_NAME)) - tag->AddItem(TAG_NAME, c->meta_name.c_str()); + if (!c->meta_name.empty() && !tag->HasType(TAG_NAME)) { + TagBuilder tag_builder(std::move(*tag)); + tag_builder.AddItem(TAG_NAME, c->meta_name.c_str()); + *tag = tag_builder.Commit(); + } c->tag = tag; } @@ -910,8 +912,10 @@ input_curl_headerfunction(void *ptr, size_t size, size_t nmemb, void *stream) delete c->tag; - c->tag = new Tag(); - c->tag->AddItem(TAG_NAME, c->meta_name.c_str()); + TagBuilder tag_builder; + tag_builder.AddItem(TAG_NAME, c->meta_name.c_str()); + + c->tag = tag_builder.CommitNew(); } else if (StringEqualsCaseASCII(name, "icy-metaint")) { char buffer[64]; size_t icy_metaint; |