# HG changeset patch # User nenolod # Date 1160885475 25200 # Node ID 5f0266d393b8fdf733f87bca90f4a3cca3d77e74 # Parent 8c9ce5aa632056cc9590e93c5324ade90cc9d993 [svn] - try to intelligently choose which output plugin is best. candidates are in an null-terminated array, pl_candidates. diff -r 8c9ce5aa6320 -r 5f0266d393b8 ChangeLog --- 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 + 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 revision [2719] - use SHARED_SUFFIX for PLUGIN_FILENAME(). diff -r 8c9ce5aa6320 -r 5f0266d393b8 audacious/main.c --- 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)