aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-12-03 13:14:11 +0100
committerMax Kellermann <max@duempel.org>2013-12-03 13:14:11 +0100
commit308fdf6e9a7229f2a2f5bb51d9528c39d595e73d (patch)
tree19e1552b7e3fa687acf9e4f0acd92abb0c4959d1 /src
parent9f4e96fdfa0967fa83444a44c8e6fdbda14b96c3 (diff)
downloadmpd-308fdf6e9a7229f2a2f5bb51d9528c39d595e73d.tar.gz
mpd-308fdf6e9a7229f2a2f5bb51d9528c39d595e73d.tar.xz
mpd-308fdf6e9a7229f2a2f5bb51d9528c39d595e73d.zip
input/curl: use class TagBuilder
Diffstat (limited to 'src')
-rw-r--r--src/input/CurlInputPlugin.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/input/CurlInputPlugin.cxx b/src/input/CurlInputPlugin.cxx
index b78545951..fa8f9affc 100644
--- a/src/input/CurlInputPlugin.cxx
+++ b/src/input/CurlInputPlugin.cxx
@@ -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"
@@ -780,8 +781,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_builder.Commit(*tag);
+ }
c->tag = tag;
}
@@ -910,8 +914,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.Commit();
} else if (StringEqualsCaseASCII(name, "icy-metaint")) {
char buffer[64];
size_t icy_metaint;