From 70c37330ee2cea62a681526ff857d9677f1beca9 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Fri, 2 Jun 2006 22:44:58 +0000 Subject: =?UTF-8?q?Improve=20quotation=20mark=20handling=20for=20StreamTit?= =?UTF-8?q?le=20in=20Shoutcast=20streams.=20(Based=20on=20a=20patch=20from?= =?UTF-8?q?=20Diego=20Petten=C3=B2.)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CVS patchset: 8011 CVS date: 2006/06/02 22:44:58 --- src/input/input_http.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/input/input_http.c b/src/input/input_http.c index fe9650206..8d8a3b488 100644 --- a/src/input/input_http.c +++ b/src/input/input_http.c @@ -19,7 +19,7 @@ * * input plugin for http network streams * - * $Id: input_http.c,v 1.116 2006/05/31 21:14:40 dsalt Exp $ + * $Id: input_http.c,v 1.117 2006/06/02 22:44:58 dsalt Exp $ */ #ifdef HAVE_CONFIG_H @@ -300,9 +300,14 @@ static int http_plugin_read_metainf (http_input_plugin_t *this) { lprintf ("http_plugin_read_metainf: %s\n", metadata_buf); /* Extract the title of the current song */ - if ((songtitle = strstr(metadata_buf, "StreamTitle='"))) { - songtitle += 13; /* skip "StreamTitle='" */ - if ((title_end = strchr(songtitle, '\''))) { + if ((songtitle = strstr(metadata_buf, "StreamTitle="))) { + char terminator[] = { ';', 0, 0 }; + songtitle += 12; /* skip "StreamTitle=" */ + if (*songtitle == '\'' || *songtitle == '"') { + terminator[0] = *songtitle++; + terminator[1] = ';'; + } + if ((title_end = strstr(songtitle, terminator))) { *title_end = '\0'; if ((!this->shoutcast_songtitle || -- cgit v1.2.3