changeset 4828:e413f6dffd21

Sort by probe_priority. Noisy decision logic for the plugins while we work this out.
author Tony Vroon <chainsaw@gentoo.org>
date Sat, 28 Feb 2009 02:35:27 +0000
parents aa98096c7f68
children e286934cd9f2
files src/audlegacy/pluginenum.c
diffstat 1 files changed, 21 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/audlegacy/pluginenum.c	Fri Feb 27 19:21:36 2009 -0600
+++ b/src/audlegacy/pluginenum.c	Sat Feb 28 02:35:27 2009 +0000
@@ -457,10 +457,7 @@
 outputlist_compare_func(gconstpointer a, gconstpointer b)
 {
     const OutputPlugin *ap = a, *bp = b;
-    if(ap->description && bp->description)
-        return strcasecmp(ap->description, bp->description);
-    else
-        return 0;
+    return (bp->probe_priority - ap->probe_priority);
 }
 
 static gint
@@ -922,7 +919,26 @@
             if (cfg.outputplugin && !strcmp(g_path_get_basename(cfg.outputplugin), g_path_get_basename(op->filename)))
             {
                 op_data.current_output_plugin = op;
-                goto found_output;
+		if (op->init)
+		{
+		    OutputPluginInitStatus ret = op->init();
+		    if (ret == OUTPUT_PLUGIN_INIT_NO_DEVICES)
+		    {
+		        printf("Plugin %s reports no devices. Attempting to avert disaster, trying others.\n", 
+		          g_path_get_basename(op->filename));
+                    } else if (ret == OUTPUT_PLUGIN_INIT_FAIL) {
+		        printf("Plugin %s was unable to initialise. Attemping to avert disaster, trying others.\n", 
+		          g_path_get_basename(op->filename));
+                    } else if (ret == OUTPUT_PLUGIN_INIT_FOUND_DEVICES) {
+		        goto found_output;
+                    } else {
+		        printf("Plugin %s did not report status. Do you still need to convert it? Will proceed for now.\n",
+		          g_path_get_basename(op->filename));
+		        goto found_output;
+                    }
+		} else {
+                   goto found_output;
+                }
             }
 
             if (op->init && op->probe_priority == prio)