Mercurial > audlegacy
diff src/audacious/input.c @ 4094:cc8e81a84fa6
Automated merge with ssh://hg.atheme.org//hg/audacious
| author | William Pitcock <nenolod@atheme.org> |
|---|---|
| date | Wed, 19 Dec 2007 00:35:57 -0600 |
| parents | 1198b6911ca4 9e24c8746d99 |
| children | fe0f7a72facd |
line wrap: on
line diff
--- a/src/audacious/input.c Wed Dec 19 00:35:24 2007 -0600 +++ b/src/audacious/input.c Wed Dec 19 00:35:57 2007 -0600 @@ -572,14 +572,16 @@ ProbeResult *pr; if (filename == NULL) - return NULL; + return NULL; filename_proxy = g_strdup(filename); pr = input_check_file(filename_proxy, FALSE); - if (!pr) + if (!pr) { + g_free(filename_proxy); return NULL; + } ip = pr->ip; @@ -589,23 +591,24 @@ input = ip->get_song_tuple(filename_proxy); else { - gchar *tmp; + gchar *scratch; - input = tuple_new(); + scratch = uri_to_display_basename(filename); + tuple_associate_string(input, FIELD_FILE_NAME, NULL, scratch); + g_free(scratch); - tmp = g_strdup(filename); - if ((ext = strrchr(tmp, '.'))) - *ext = '\0'; + scratch = uri_to_display_dirname(filename); + tuple_associate_string(input, FIELD_FILE_PATH, NULL, scratch); + g_free(scratch); - tuple_associate_string(input, FIELD_FILE_NAME, NULL, g_path_get_basename(tmp)); + ext = strrchr(filename, '.'); + if (ext != NULL) { + ++ext; + tuple_associate_string(input, FIELD_FILE_EXT, NULL, ext); + } - if (ext) - tuple_associate_string(input, FIELD_FILE_EXT, NULL, ext + 1); - - tuple_associate_string(input, FIELD_FILE_PATH, NULL, g_path_get_dirname(tmp)); tuple_associate_int(input, FIELD_LENGTH, NULL, -1); - g_free(tmp); } g_free(filename_proxy);
