changeset 1883:5f0266d393b8 trunk

[svn] - try to intelligently choose which output plugin is best. candidates are in an null-terminated array, pl_candidates.
author nenolod
date Sat, 14 Oct 2006 21:11:15 -0700
parents 8c9ce5aa6320
children e6a3a7d80182
files ChangeLog audacious/main.c
diffstat 2 files changed, 29 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Oct 14 21:01:33 2006 -0700
+++ b/ChangeLog	Sat Oct 14 21:11:15 2006 -0700
@@ -1,3 +1,11 @@
+2006-10-15 04:01:33 +0000  William Pitcock <nenolod@nenolod.net>
+  revision [2721]
+  - SHARED_SUFFIX includes the dot
+  
+  trunk/audacious/pluginenum.h |    2 +-
+  1 file changed, 1 insertion(+), 1 deletion(-)
+
+
 2006-10-15 03:58:52 +0000  William Pitcock <nenolod@nenolod.net>
   revision [2719]
   - use SHARED_SUFFIX for PLUGIN_FILENAME().
--- a/audacious/main.c	Sat Oct 14 21:01:33 2006 -0700
+++ b/audacious/main.c	Sat Oct 14 21:11:15 2006 -0700
@@ -370,6 +370,18 @@
 
 gboolean starting_up = TRUE;
 
+/* XXX: case-sensitivity is bad for lazy nenolods. :( -nenolod */
+static gchar *pl_candidates[] = {
+	PLUGIN_FILENAME("ALSA"),
+	PLUGIN_FILENAME("OSS"),
+	PLUGIN_FILENAME("coreaudio"),
+	PLUGIN_FILENAME("sun"),
+	PLUGIN_FILENAME("ESD"),
+	PLUGIN_FILENAME("pulse_audio"),
+	PLUGIN_FILENAME("disk_writer"),
+	NULL
+};
+
 static GSList *
 get_feature_list(void)
 {
@@ -549,15 +561,15 @@
         cfg.gentitle_format = g_strdup("%{p:%p - %}%{a:%a - %}%t");
 
     if (!cfg.outputplugin) {
-#ifdef HAVE_OSS
-        cfg.outputplugin = g_build_filename(PLUGIN_DIR, plugin_dir_list[0],
-                                            PLUGIN_FILENAME("OSS"), NULL);
-#else
-        /* FIXME: This implicitly means the output plugin that is
-         * first in the alphabet will be used (usually the disk writer
-         * plugin) */
-        cfg.outputplugin = g_strdup("");
-#endif
+	gint iter;
+        gchar *pl_path = g_build_filename(PLUGIN_DIR, plugin_dir_list[0], NULL);
+
+        for (iter = 0; pl_candidates[iter] != NULL && cfg.outputplugin == NULL; iter++)
+	{
+	     cfg.outputplugin = find_file_recursively(pl_path, pl_candidates[iter]);
+	}
+
+        g_free(pl_path);
     }
 
     if (!cfg.eqpreset_default_file)