icyName fix

git-svn-id: https://svn.musicpd.org/mpd/trunk@1271 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Warren Dukes 2004-06-01 01:28:40 +00:00
parent 4ba7779c89
commit c38fcd30c7

View File

@ -368,20 +368,24 @@ static int getHTTPHello(InputStream * inStream) {
data->icyMetaint = atoi(cur+14);
}
else if(0 == strncmp(cur, "\r\nicy-name:", 11)) {
char * temp = strstr(cur+11,"\r\n");
int incr = 11;
char * temp = strstr(cur+incr,"\r\n");
if(!temp) break;
*temp = '\0';
if(inStream->metaTitle) free(inStream->metaTitle);
inStream->metaTitle = strdup(cur+19);
while(*(incr+cur) == ' ') incr++;
inStream->metaTitle = strdup(cur+incr);
*temp = '\r';
DEBUG("stream icy-name: %s\n", inStream->metaTitle);
}
else if(0 == strncmp(cur, "\r\nx-audiocast-name:", 19)) {
char * temp = strstr(cur+19,"\r\n");
int incr = 19;
char * temp = strstr(cur+incr,"\r\n");
if(!temp) break;
*temp = '\0';
if(inStream->metaTitle) free(inStream->metaTitle);
inStream->metaTitle = strdup(cur+19);
while(*(incr+cur) == ' ') incr++;
inStream->metaTitle = strdup(cur+incr);
*temp = '\r';
DEBUG("stream audiocast-name: %s\n",
inStream->metaTitle);