aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-26 21:20:02 +0100
committerMax Kellermann <max@duempel.org>2008-10-26 21:20:02 +0100
commit5f2384001ecd02dbd49985e63faa2000ce9700df (patch)
treeda264f6ca131f1539aff6aa5512623d46be7f87f /src
parent5d9ef0cd8353a049be6aaf838f0f3d89fd93d966 (diff)
downloadmpd-5f2384001ecd02dbd49985e63faa2000ce9700df.tar.gz
mpd-5f2384001ecd02dbd49985e63faa2000ce9700df.tar.xz
mpd-5f2384001ecd02dbd49985e63faa2000ce9700df.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/input_curl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/input_curl.c b/src/input_curl.c
index df9f43517..ad471795e 100644
--- a/src/input_curl.c
+++ b/src/input_curl.c
@@ -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;