diff src/audacious/pluginenum.c @ 3959:a575c29cee05

- revive on-demand metadata retrieving. in the combination with "Detect file formats on demand", now audacious can load large directory in a few seconds. - revise ext_hash to have lists of input plugins which associated with each extension. - now input_check_file() makes use of ext_hash for file format probing to avoid full scan in the input list. - make "detect file formats on demand" default. - change tooltip text for on demand {detect|metadata}. - move update request for playlist from idle function to event queue.
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Sat, 17 Nov 2007 17:07:46 +0900
parents e924c9ee3958
children 572258c68dfb
line wrap: on
line diff
--- a/src/audacious/pluginenum.c	Fri Nov 16 18:55:48 2007 +0100
+++ b/src/audacious/pluginenum.c	Sat Nov 17 17:07:46 2007 +0900
@@ -524,7 +524,16 @@
     gint i;
     if(p->vfs_extensions) {
         for(i = 0; p->vfs_extensions[i] != NULL; i++) {
-            g_hash_table_replace(ext_hash, g_strdup(p->vfs_extensions[i]), g_strdup(p->description));
+            GList *hdr = NULL;
+            GList **handle = NULL; //allocated as auto in stack.
+            GList **handle2 = g_malloc(sizeof(GList **));
+
+            handle = g_hash_table_lookup(ext_hash, p->vfs_extensions[i]);
+            if(handle)
+                hdr = *handle;
+            hdr = g_list_append(hdr, p); //returned hdr is non-volatile
+            *handle2 = hdr;
+            g_hash_table_replace(ext_hash, g_strdup(p->vfs_extensions[i]), handle2);
         }
     }
 }