comparison src/xspf/xspf.c @ 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 9fa5a7884514
children 02cfac0efbdc
comparison
equal deleted inserted replaced
2168:3c9527d25346 2169:838098201ac9
189 if (location) { 189 if (location) {
190 gchar *uri = NULL, *realfn = NULL, *scratch = NULL; 190 gchar *uri = NULL, *realfn = NULL, *scratch = NULL;
191 191
192 /* filename and path in tuple must be unescaped. */ 192 /* filename and path in tuple must be unescaped. */
193 scratch = g_filename_from_uri(location, NULL, NULL); 193 scratch = g_filename_from_uri(location, NULL, NULL);
194 realfn = aud_str_to_utf8(scratch ? scratch : location); 194
195 uri = aud_str_to_utf8(scratch ? location : scratch); 195 if (scratch != NULL) {
196 g_free(scratch); 196 realfn = aud_str_to_utf8(scratch ? scratch : location);
197 uri = aud_str_to_utf8(scratch ? location : scratch);
198 g_free(scratch);
199 } else {
200 realfn = g_strdup(location);
201 uri = g_strdup(location);
202 }
197 203
198 scratch = g_path_get_basename(realfn); 204 scratch = g_path_get_basename(realfn);
199 aud_tuple_associate_string(tuple, FIELD_FILE_NAME, NULL, scratch); 205 aud_tuple_associate_string(tuple, FIELD_FILE_NAME, NULL, scratch);
200 g_free(scratch); 206 g_free(scratch);
201 207