# HG changeset patch # User Tony Vroon # Date 1235788527 0 # Node ID e413f6dffd2138de357d0cf44b0fdec7c115ad7c # Parent aa98096c7f6886329b9cbee47c6bfa5674fa1190 Sort by probe_priority. Noisy decision logic for the plugins while we work this out. diff -r aa98096c7f68 -r e413f6dffd21 src/audlegacy/pluginenum.c --- 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)