From 33a147b31e9798a9a5a73d95ccbf4e5df73b3a9e Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Mon, 7 Jun 2004 05:21:55 +0000 Subject: remove the initial and trailing ' from the icy StreamTitle that shoutcast likes to insert git-svn-id: https://svn.musicpd.org/mpd/trunk@1366 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/inputStream_http.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/inputStream_http.c b/src/inputStream_http.c index 26637adf3..a7bdf295f 100644 --- a/src/inputStream_http.c +++ b/src/inputStream_http.c @@ -460,9 +460,14 @@ static void parseIcyMetadata(InputStream * inStream, char * metadata, s = strtok_r(temp, ";", &r); while(s) { if(0 == strncmp(s, "StreamTitle=", 12)) { - printf("StreamTitle: %s\n", s+12); + int cur = 12; + printf("StreamTitle: %s\n", s+cur); if(inStream->metaTitle) free(inStream->metaTitle); - inStream->metaTitle = strdup(s+12); + if(*(s+cur) == '\'') cur++; + if(s[strlen(s)-1] == '\'') { + s[strlen(s)-1] = '\0'; + } + inStream->metaTitle = strdup(s+cur); } s = strtok_r(NULL, ";", &r); } -- cgit v1.2.3