aboutsummaryrefslogtreecommitdiff
path: root/src/input
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-28 23:41:45 +0100
committerMax Kellermann <max@duempel.org>2013-01-28 23:41:45 +0100
commit76417d44464248949e7843eee0d5338a8e0a22ac (patch)
treec8f6416505b7268ce4f3902660ba35f4e35d1c04 /src/input
parentcffc78ad6a978c8ef0afae4fbdd4b189612a7167 (diff)
InputStream: use std::string
Diffstat (limited to 'src/input')
-rw-r--r--src/input/CurlInputPlugin.cxx5
-rw-r--r--src/input/RewindInputPlugin.cxx10
2 files changed, 6 insertions, 9 deletions
diff --git a/src/input/CurlInputPlugin.cxx b/src/input/CurlInputPlugin.cxx
index f3edf1dc..550bcd0c 100644
--- a/src/input/CurlInputPlugin.cxx
+++ b/src/input/CurlInputPlugin.cxx
@@ -925,8 +925,7 @@ input_curl_headerfunction(void *ptr, size_t size, size_t nmemb, void *stream)
c->base.size = c->base.offset + g_ascii_strtoull(buffer, NULL, 10);
} else if (g_ascii_strcasecmp(name, "content-type") == 0) {
- g_free(c->base.mime);
- c->base.mime = g_strndup(value, end - value);
+ c->base.mime.assign(value, end);
} else if (g_ascii_strcasecmp(name, "icy-name") == 0 ||
g_ascii_strcasecmp(name, "ice-name") == 0 ||
g_ascii_strcasecmp(name, "x-audiocast-name") == 0) {
@@ -1031,7 +1030,7 @@ input_curl_easy_init(struct input_curl *c, GError **error_r)
g_free(proxy_auth_str);
}
- code = curl_easy_setopt(c->easy, CURLOPT_URL, c->base.uri);
+ code = curl_easy_setopt(c->easy, CURLOPT_URL, c->base.uri.c_str());
if (code != CURLE_OK) {
g_set_error(error_r, curl_quark(), code,
"curl_easy_setopt() failed: %s",
diff --git a/src/input/RewindInputPlugin.cxx b/src/input/RewindInputPlugin.cxx
index 362e55b3..207d9ff0 100644
--- a/src/input/RewindInputPlugin.cxx
+++ b/src/input/RewindInputPlugin.cxx
@@ -61,7 +61,7 @@ struct RewindInputStream {
char buffer[64 * 1024];
RewindInputStream(input_stream *_input)
- :base(rewind_input_plugin, _input->uri,
+ :base(rewind_input_plugin, _input->uri.c_str(),
_input->mutex, _input->cond),
input(_input), tail(0) {
}
@@ -89,7 +89,7 @@ struct RewindInputStream {
const struct input_stream *src = input;
assert(dest != src);
- assert(src->mime == NULL || dest->mime != src->mime);
+ assert(src->mime.empty() || dest->mime != src->mime);
bool dest_ready = dest->ready;
@@ -98,10 +98,8 @@ struct RewindInputStream {
dest->size = src->size;
dest->offset = src->offset;
- if (!dest_ready && src->ready) {
- g_free(dest->mime);
- dest->mime = g_strdup(src->mime);
- }
+ if (!dest_ready && src->ready)
+ dest->mime = src->mime;
}
};