# HG changeset patch # User nenolod # Date 1165981885 28800 # Node ID 81c744358bab5470a0b0c82cbd170d6cad6db71d # Parent 82a6284108c1ab5dcdb0f792b9edb1b6502c5483 [svn] - improved logic for extension assist diff -r 82a6284108c1 -r 81c744358bab ChangeLog --- a/ChangeLog Tue Dec 12 19:29:15 2006 -0800 +++ b/ChangeLog Tue Dec 12 19:51:25 2006 -0800 @@ -1,3 +1,11 @@ +2006-12-13 03:29:15 +0000 William Pitcock + revision [3227] + - put this back the way it was + + trunk/audacious/plugin.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + + 2006-12-13 03:15:23 +0000 William Pitcock revision [3225] - specifically define this as a table diff -r 82a6284108c1 -r 81c744358bab audacious/input.c --- a/audacious/input.c Tue Dec 12 19:29:15 2006 -0800 +++ b/audacious/input.c Tue Dec 12 19:51:25 2006 -0800 @@ -415,10 +415,13 @@ InputPlugin *ip; gchar *filename_proxy; gint ret = 1; + gchar *ext; filename_proxy = g_strdup(filename); fd = vfs_fopen(filename, "rb"); + ext = strrchr(filename) + 1; + for (node = get_input_list(); node != NULL; node = g_list_next(node)) { ip = INPUT_PLUGIN(node->data); @@ -427,50 +430,47 @@ continue; vfs_fseek(fd, 0, SEEK_SET); - if (cfg.use_extension_probing != TRUE || ip->vfs_extensions == NULL) - { - if (ip->is_our_file_from_vfs != NULL) - { - ret = ip->is_our_file_from_vfs(filename_proxy, fd); - - if (ret > 0) - { - g_free(filename_proxy); - vfs_fclose(fd); - return ip; - } - } - else if (ip->is_our_file != NULL) - { - ret = ip->is_our_file(filename_proxy); - - if (ret > 0) - { - g_free(filename_proxy); - vfs_fclose(fd); - return ip; - } - } - } - else + if (cfg.use_extension_probing == TRUE && ip->vfs_extensions != NULL + && ext != NULL && ext != 1) { gint i; - gchar *ext = strrchr(filename_proxy, '.'); - - if (ext == NULL) - continue; - - ext++; + gboolean is_our_ext = FALSE; for (i = 0; ip->vfs_extensions[i] != NULL; i++) { if (!g_strcasecmp(ip->vfs_extensions[i], ext)) - { - g_free(filename_proxy); - vfs_fclose(fd); - return ip; - } + { + is_our_ext = TRUE; + break; + } + } + + /* not a plugin that supports this extension */ + if (is_our_ext == FALSE) + continue; + } + + if (ip->is_our_file_from_vfs != NULL) + { + ret = ip->is_our_file_from_vfs(filename_proxy, fd); + + if (ret > 0) + { + g_free(filename_proxy); + vfs_fclose(fd); + return ip; + } + } + else if (ip->is_our_file != NULL) + { + ret = ip->is_our_file(filename_proxy); + + if (ret > 0) + { + g_free(filename_proxy); + vfs_fclose(fd); + return ip; } }