aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-06-07 05:21:55 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-06-07 05:21:55 +0000
commit33a147b31e9798a9a5a73d95ccbf4e5df73b3a9e (patch)
tree2f92e69e11fd9e211524c8af926e26f2edbe1c74
parent283e34eaae554604ed1f2f848026840c0eed3dfd (diff)
downloadmpd-33a147b31e9798a9a5a73d95ccbf4e5df73b3a9e.tar.gz
mpd-33a147b31e9798a9a5a73d95ccbf4e5df73b3a9e.tar.xz
mpd-33a147b31e9798a9a5a73d95ccbf4e5df73b3a9e.zip
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
Diffstat (limited to '')
-rw-r--r--src/inputStream_http.c9
1 files 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);
}