Mercurial > audlegacy-plugins
diff src/xspf/xspf.c @ 647:f684905cf688 trunk
[svn] - add mms:// as a streaming scheme.
author | yaz |
---|---|
date | Tue, 13 Feb 2007 22:58:09 -0800 |
parents | 94ab06db73fa |
children | 7f865e3cd285 |
line wrap: on
line diff
--- a/src/xspf/xspf.c Tue Feb 13 22:54:57 2007 -0800 +++ b/src/xspf/xspf.c Tue Feb 13 22:58:09 2007 -0800 @@ -278,18 +278,21 @@ track = xmlNewNode(NULL, (xmlChar *)"track"); location = xmlNewNode(NULL, (xmlChar *)"location"); - /* url encode file name. exclude streaming for now. */ - if (strncasecmp("http://", entry->filename, 7) && - strncasecmp("https://", entry->filename, 8)) { /* the rest */ + /* uri escape entry->filename */ + if ( !strncasecmp("http://", entry->filename, 7) || + !strncasecmp("https://", entry->filename, 8) || + !strncasecmp("mms://", entry->filename, 6) ) /* streaming */ + { + gchar *tmp = (gchar *)xmlURIEscape((xmlChar *)entry->filename); + filename = g_strdup(tmp ? tmp : entry->filename); + g_free(tmp); + } + else /* local file */ + { gchar *tmp = (gchar *)xmlPathToURI((const xmlChar *)entry->filename); filename = g_strdup_printf("file://%s", tmp); g_free(tmp); } - else { /* streaming */ - gchar *tmp = (gchar *)xmlURIEscape((xmlChar *)entry->filename); - filename = g_strdup(tmp ? tmp : entry->filename); - g_free(tmp); - } if(!g_utf8_validate(filename, -1, NULL)) continue;