aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputStream_http.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-05-31 11:42:46 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-05-31 11:42:46 +0000
commit000e053ce73f6f87bc7c3797caceb1b60e467dcf (patch)
tree2411ee50bcd20c53cb8ed6f82bfb76ee5227d77b /src/inputStream_http.c
parentb4a91d574fb3ad8ffdacab792a46cc668010c7d6 (diff)
downloadmpd-000e053ce73f6f87bc7c3797caceb1b60e467dcf.tar.gz
mpd-000e053ce73f6f87bc7c3797caceb1b60e467dcf.tar.xz
mpd-000e053ce73f6f87bc7c3797caceb1b60e467dcf.zip
icynames are now copied to title of streams
git-svn-id: https://svn.musicpd.org/mpd/trunk@1258 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/inputStream_http.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/inputStream_http.c b/src/inputStream_http.c
index ab06a3c89..5a4aef2d8 100644
--- a/src/inputStream_http.c
+++ b/src/inputStream_http.c
@@ -56,7 +56,6 @@ typedef struct _InputStreemHTTPData {
size_t buflen;
int timesRedirected;
int icyMetaint;
- char * icyName;
int prebuffer;
} InputStreamHTTPData;
@@ -68,7 +67,6 @@ static InputStreamHTTPData * newInputStreamHTTPData() {
ret->port = 80;
ret->connState = HTTP_CONN_STATE_CLOSED;
ret->timesRedirected = 0;
- ret->icyName = NULL;
ret->icyMetaint = 0;
ret->prebuffer = 0;
@@ -78,7 +76,6 @@ static InputStreamHTTPData * newInputStreamHTTPData() {
static void freeInputStreamHTTPData(InputStreamHTTPData * data) {
if(data->host) free(data->host);
if(data->path) free(data->path);
- if(data->icyName) free(data->icyName);
free(data);
}
@@ -374,19 +371,20 @@ static int getHTTPHello(InputStream * inStream) {
char * temp = strstr(cur+11,"\r\n");
if(!temp) break;
*temp = '\0';
- if(data->icyName) free(data->icyName);
- data->icyName = strdup(cur+11);
+ if(inStream->metaTitle) free(inStream->metaTitle);
+ inStream->metaTitle = strdup(cur+19);
*temp = '\r';
- DEBUG("stream icy-name: %s\n", data->icyName);
+ 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");
if(!temp) break;
*temp = '\0';
- if(data->icyName) free(data->icyName);
- data->icyName = strdup(cur+19);
+ if(inStream->metaTitle) free(inStream->metaTitle);
+ inStream->metaTitle = strdup(cur+19);
*temp = '\r';
- DEBUG("stream audiocast-name: %s\n", data->icyName);
+ DEBUG("stream audiocast-name: %s\n",
+ inStream->metaTitle);
}
else if(0 == strncmp(cur, "\r\nContent-Type:", 15)) {
int incr = 15;
@@ -445,6 +443,7 @@ int inputStream_httpOpen(InputStream * inStream, char * url) {
inStream->error = 0;
inStream->mime = NULL;
inStream->seekable = 0;
+ inStream->metaTitle = NULL;
return 0;
}