Commit 5f238400 authored by Max Kellermann's avatar Max Kellermann

curl: read stream name from HTTP response headers

If the server sends the headers "icy-name", "ice-name", "x-audiocast-name", set the stream title.
parent 5d9ef0cd
...@@ -319,6 +319,11 @@ input_curl_headerfunction(void *ptr, size_t size, size_t nmemb, void *stream) ...@@ -319,6 +319,11 @@ input_curl_headerfunction(void *ptr, size_t size, size_t nmemb, void *stream)
} else if (strcasecmp(name, "content-type") == 0) { } else if (strcasecmp(name, "content-type") == 0) {
g_free(is->mime); g_free(is->mime);
is->mime = g_strndup(value, end - value); is->mime = g_strndup(value, end - value);
} else if (strcasecmp(name, "icy-name") == 0 ||
strcasecmp(name, "ice-name") == 0 ||
strcasecmp(name, "x-audiocast-name") == 0) {
g_free(is->meta_name);
is->meta_name = g_strndup(value, end - value);
} }
return size; return size;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment