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:
parent
5d9ef0cd83
commit
5f2384001e
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user