diff options
Diffstat (limited to 'src/input')
-rw-r--r-- | src/input/CurlInputPlugin.cxx | 5 | ||||
-rw-r--r-- | src/input/RewindInputPlugin.cxx | 10 |
2 files changed, 6 insertions, 9 deletions
diff --git a/src/input/CurlInputPlugin.cxx b/src/input/CurlInputPlugin.cxx index f3edf1dc8..550bcd0ce 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 362e55b3f..207d9ff0f 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; } }; |