# HG changeset patch # User William Pitcock # Date 1185957417 18000 # Node ID 7628b2b7a6880867d6bf8f7e3387c1ecd317d8ac # Parent dcc92b58f06ed19d1c6f26c900ba676cd08e619a Don't explicitly trust the mimetype, still do a probe. diff -r dcc92b58f06e -r 7628b2b7a688 src/audacious/input.c --- a/src/audacious/input.c Fri Jul 27 19:44:14 2007 -0500 +++ b/src/audacious/input.c Wed Aug 01 03:36:57 2007 -0500 @@ -412,13 +412,56 @@ mimetype = vfs_get_metadata(fd, "content-type"); if ((ip = mime_get_plugin(mimetype)) != NULL) { - g_free(filename_proxy); - vfs_fclose(fd); + if (!input_is_enabled(ip->filename)) + break; + + if (ip->probe_for_tuple != NULL) + { + TitleInput *tuple = ip->probe_for_tuple(filename_proxy, fd); + + if (tuple != NULL) + { + g_free(filename_proxy); + vfs_fclose(fd); + + pr = g_new0(ProbeResult, 1); + pr->ip = ip; + pr->tuple = tuple; + pr->tuple->mtime = input_get_mtime(filename_proxy); + + return pr; + } + } + else if (fd && ip->is_our_file_from_vfs != NULL) + { + ret = ip->is_our_file_from_vfs(filename_proxy, fd); - pr = g_new0(ProbeResult, 1); - pr->ip = ip; + if (ret > 0) + { + g_free(filename_proxy); + vfs_fclose(fd); + + pr = g_new0(ProbeResult, 1); + pr->ip = ip; - return pr; + return pr; + } + } + else if (ip->is_our_file != NULL) + { + ret = ip->is_our_file(filename_proxy); + + if (ret > 0) + { + g_free(filename_proxy); + vfs_fclose(fd); + + pr = g_new0(ProbeResult, 1); + pr->ip = ip; + + return pr; + } + } } for (node = get_input_list(); node != NULL; node = g_list_next(node))