Blob Blame History Raw
diff -Nur audacious-2.2-orig/src/audacious/playlist-utils.c audacious-2.2-multiple-decoders-per-ext/src/audacious/playlist-utils.c
--- audacious-2.2-orig/src/audacious/playlist-utils.c	2009-11-22 23:43:47.000000000 +0100
+++ audacious-2.2-multiple-decoders-per-ext/src/audacious/playlist-utils.c	2010-01-21 13:59:13.000000000 +0100
@@ -286,33 +286,39 @@
 InputPlugin * filename_find_decoder (const gchar * filename)
 {
     InputPlugin * decoder = NULL;
-    gchar * temp = g_strdup (filename);
+    gchar *temp = filename_split_subtune(filename, NULL);;
     gchar * temp2;
-    GList * * index;
+    GList **list_hdr;
 
     decoder = uri_get_plugin (temp);
 
     if (decoder != NULL)
         goto DONE;
 
-    temp2 = strrchr (temp, '?');
-
-    if (temp2 != NULL)
-        * temp2 = 0;
-
     temp2 = strrchr (temp, '.');
 
     if (temp2 == NULL)
         goto DONE;
 
     temp2 = g_ascii_strdown (temp2 + 1, -1);
-    g_free (temp);
-    temp = temp2;
-
-    index = g_hash_table_lookup (ext_hash, temp);
+    list_hdr = g_hash_table_lookup (ext_hash, temp2);
+    g_free(temp2);
 
-    if (index != NULL)
-        decoder = (* index)->data;
+    if (list_hdr != NULL) {
+        if (g_list_length(*list_hdr) > 1) {
+            ProbeResult *pr = input_check_file(temp);
+            if (pr) {
+                decoder = pr->ip;
+                g_free(pr);
+            }
+        }
+        else {
+            InputPlugin* ip = INPUT_PLUGIN((*list_hdr)->data);
+            if (ip->enabled) {
+                decoder = ip;
+            }
+        }
+    }
 
 DONE:
      g_free (temp);