changeset 1594:78d8dd386d0b

Kludge xspf plugin to "work" better with playlist entries which have characters requiring encoding. This is not a real fix, though.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 05 Sep 2007 02:22:40 +0300
parents f2f0ea5b5876
children a08203b533da
files src/xspf/xspf.c
diffstat 1 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/xspf/xspf.c	Wed Sep 05 02:11:41 2007 +0300
+++ b/src/xspf/xspf.c	Wed Sep 05 02:22:40 2007 +0300
@@ -112,16 +112,16 @@
         if(nptr->type == XML_ELEMENT_NODE
            && !xmlStrcmp(nptr->name, (xmlChar *)"location")) {
             gchar *str = (gchar *)xmlNodeGetContent(nptr);
-            gchar *tmp = NULL;
 
-            // tmp is escaped uri or a part of escaped uri.
-            tmp = g_strdup_printf("%s%s", base ? base : "", str);
-            location = g_filename_from_uri(tmp, NULL, NULL);
-            if(!location) // http:// or something.
-                location = g_strdup(tmp);
-
-            xmlFree(str); str = NULL;
-            g_free(tmp); tmp = NULL;
+            location = g_strdup_printf("%s%s", base ? base : "", str);
+            xmlFree(str);
+            str = g_filename_from_uri(location, NULL, NULL);
+            if (str) {
+                g_free(location);
+                location = g_strdup_printf("file://%s", str);
+            }
+            
+            g_free(str);
         }
         else if(nptr->type == XML_ELEMENT_NODE
                 && !xmlStrcmp(nptr->name, (xmlChar *)"title")) {