Группа :: Звук
Пакет: xmms
Главная Изменения Спек Патчи Загрузить Bugs and FR
Патч: xmms-1.2.10-alt-arts.patch
diff -Naur xmms-1.2.10-orig/xmms/main.c xmms-1.2.10/xmms/main.c
--- xmms-1.2.10-orig/xmms/main.c 2004-02-23 22:31:43 +0200
+++ xmms-1.2.10/xmms/main.c 2004-02-25 14:03:13 +0200
@@ -302,6 +302,37 @@
sizeof(mainwin_general_menu_entries) /
sizeof(mainwin_general_menu_entries[0]);
+#include <artsc/artsc.h>
+#include <dlfcn.h>
+
+/* dlopen libarts, for seeing if we should use this as the default plugin. */
+static int arts_running(void) {
+ void *arts_handle;
+ int (*a_init)(void);
+ void (*a_close)(void);
+ int ret = 0;
+
+ arts_handle = dlopen("libartsc.so.0", RTLD_NOW);
+ if (!arts_handle)
+ return 0;
+
+ a_init = dlsym(arts_handle, "arts_init");
+ a_close = dlsym(arts_handle, "arts_free");
+ if (!a_init || !a_close) {
+ dlclose(arts_handle);
+ return 0;
+ }
+ signal(SIGPIPE, SIG_DFL);
+ if ((*a_init)() == 0) {
+ ret = 1;
+ (*a_close)();
+ }
+ signal(SIGPIPE, SIG_IGN);
+ dlclose(arts_handle);
+ return ret;
+}
+
+
static void make_xmms_dir(void)
{
gchar *filename;
@@ -495,6 +526,22 @@
cfg.gentitle_format = g_strdup("%p - %t");
if (cfg.outputplugin == NULL)
{
+ /* If aRts is running and the plugin is there, use that... */
+ if (arts_running())
+ {
+ cfg.outputplugin = g_strdup_printf("%s/%s/libarts.so", PLUGIN_DIR, plugin_dir_list[0]);
+ if (access(cfg.outputplugin, R_OK))
+ {
+ g_free(cfg.outputplugin);
+ cfg.outputplugin = NULL;
+ fprintf(stderr, "** artsd running, install xmms-out-arts package please\n");
+ } else {
+ fprintf(stderr, "** artsd running, auto-enabling arts output plugin (found)\n");
+ }
+ }
+ }
+ if (cfg.outputplugin == NULL)
+ {
#ifdef HAVE_OSS
cfg.outputplugin = g_strdup_printf("%s/%s/libOSS.so", PLUGIN_DIR, plugin_dir_list[0]);
#elif defined(sun)
@@ -507,6 +554,13 @@
cfg.outputplugin = g_strdup("");
#endif
}
+ /* Migrate users of the previous arts plugin */
+ if (!strcmp(g_basename(cfg.outputplugin),"libartsout.so")) {
+ if (access(cfg.outputplugin,R_OK)) {
+ g_free(cfg.outputplugin);
+ cfg.outputplugin = g_strdup_printf("%s/%s/libarts.so", PLUGIN_DIR, plugin_dir_list[0]);
+ }
+ }
if (cfg.eqpreset_default_file == NULL)
cfg.eqpreset_default_file = g_strdup("dir_default.preset");
if (cfg.eqpreset_extension == NULL)