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.
This commit is contained in:
Max Kellermann 2008-10-26 21:20:02 +01:00
parent 5d9ef0cd83
commit 5f2384001e

View File

@ -319,6 +319,11 @@ input_curl_headerfunction(void *ptr, size_t size, size_t nmemb, void *stream)
} else if (strcasecmp(name, "content-type") == 0) {
g_free(is->mime);
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;