# HG changeset patch # User William Pitcock # Date 1183976021 18000 # Node ID a5f606b0103850dfaff62b28b364d78b66329818 # Parent 2897d744d87ac274b3acb6e59508496404598eb8 Use mimetype system to accelerate detection of network streams. diff -r 2897d744d87a -r a5f606b01038 src/audacious/input.c --- a/src/audacious/input.c Mon Jul 09 03:18:40 2007 -0500 +++ b/src/audacious/input.c Mon Jul 09 05:13:41 2007 -0500 @@ -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);