summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2006-06-02 22:44:58 +0000
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2006-06-02 22:44:58 +0000
commit70c37330ee2cea62a681526ff857d9677f1beca9 (patch)
tree0b3636d8f5c9f72834e529d49693a78e76de7a9b /src
parenta44b2d4d4a506fc00f4cbe27c5ac9c74fb86983e (diff)
downloadxine-lib-70c37330ee2cea62a681526ff857d9677f1beca9.tar.gz
xine-lib-70c37330ee2cea62a681526ff857d9677f1beca9.tar.bz2
Improve quotation mark handling for StreamTitle in Shoutcast streams.
(Based on a patch from Diego Pettenò.) CVS patchset: 8011 CVS date: 2006/06/02 22:44:58
Diffstat (limited to 'src')
-rw-r--r--src/input/input_http.c13
1 files changed, 9 insertions, 4 deletions
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 ||