# HG changeset patch # User Tomasz Mon # Date 1183979105 -7200 # Node ID 80cf8f8b06517eab6c1ba2f0bbf8ef56e53408e2 # Parent e84073b61ba55c76571d4a21e17b25b2ff393f16# Parent 02a62ac3d9c2730f8bfd4c9dc031766eeb4dcdf0 branch merge diff -r e84073b61ba5 -r 80cf8f8b0651 src/audacious/input.c --- a/src/audacious/input.c Mon Jul 09 13:02:50 2007 +0200 +++ b/src/audacious/input.c Mon Jul 09 13:05:05 2007 +0200 @@ -317,6 +317,10 @@ * Adapted to use the NewVFS extension probing system if enabled. * * --nenolod, Dec 12 2006 + * + * Adapted to use the mimetype system. + * + * --nenolod, Jul 9 2007 */ InputPlugin * input_check_file(const gchar * filename, gboolean show_warning) @@ -328,6 +332,7 @@ gint ret = 1; gchar *ext, *tmp, *tmp_uri; gboolean use_ext_filter; + gchar *mimetype; filename_proxy = g_strdup(filename); @@ -348,6 +353,14 @@ (fd != NULL && (!g_strncasecmp(filename, "/", 1) || !g_strncasecmp(filename, "file://", 7))) ? TRUE : FALSE; + mimetype = vfs_get_metadata(fd, "content-type"); + if ((ip = mime_get_plugin(mimetype)) != NULL) + { + g_free(filename_proxy); + vfs_fclose(fd); + return ip; + } + for (node = get_input_list(); node != NULL; node = g_list_next(node)) { ip = INPUT_PLUGIN(node->data); diff -r e84073b61ba5 -r 80cf8f8b0651 src/audacious/mime.c --- a/src/audacious/mime.c Mon Jul 09 13:02:50 2007 +0200 +++ b/src/audacious/mime.c Mon Jul 09 13:05:05 2007 +0200 @@ -33,6 +33,9 @@ InputPlugin *mime_get_plugin(const gchar *mimetype) { + if (mimetype == NULL) + return NULL; + if (mime_type_dict == NULL) return NULL;