changeset 2169:838098201ac9

fix loading of streams from XSPF files.
author William Pitcock <nenolod@atheme.org>
date Sat, 17 Nov 2007 19:02:51 -0600
parents 3c9527d25346
children 02cfac0efbdc
files src/xspf/xspf.c
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/xspf/xspf.c	Sat Nov 17 03:41:41 2007 +0900
+++ b/src/xspf/xspf.c	Sat Nov 17 19:02:51 2007 -0600
@@ -191,9 +191,15 @@
 
         /* filename and path in tuple must be unescaped. */
         scratch = g_filename_from_uri(location, NULL, NULL);
-        realfn = aud_str_to_utf8(scratch ? scratch : location);
-        uri = aud_str_to_utf8(scratch ? location : scratch);
-        g_free(scratch);
+
+        if (scratch != NULL) {
+            realfn = aud_str_to_utf8(scratch ? scratch : location);
+       	    uri = aud_str_to_utf8(scratch ? location : scratch);
+            g_free(scratch);
+        } else {
+            realfn = g_strdup(location);
+            uri = g_strdup(location);
+        }
 
         scratch = g_path_get_basename(realfn);
         aud_tuple_associate_string(tuple, FIELD_FILE_NAME, NULL, scratch);