From 07e8c2f636c4ecbc22d8cbbf34a15b53d02f11f2 Mon Sep 17 00:00:00 2001 From: Michael Schwendt Date: Feb 04 2010 12:27:04 +0000 Subject: - Fix non-top-level ladspa plugin dialogs. --- diff --git a/audacious-plugins-2.2-ladspa-restore.patch b/audacious-plugins-2.2-ladspa-restore.patch deleted file mode 100644 index 57db200..0000000 --- a/audacious-plugins-2.2-ladspa-restore.patch +++ /dev/null @@ -1,74 +0,0 @@ -diff -Nur audacious-plugins-2.2-orig/src/ladspa/ladspa.c audacious-plugins-2.2-ladspa/src/ladspa/ladspa.c ---- audacious-plugins-2.2-orig/src/ladspa/ladspa.c 2009-11-22 23:49:53.000000000 +0100 -+++ audacious-plugins-2.2-ladspa/src/ladspa/ladspa.c 2010-02-04 12:07:59.000000000 +0100 -@@ -145,7 +145,6 @@ - - static void restore(void) - { --#if 0 - mcs_handle_t *db; - gint k, plugins = 0; - -@@ -157,16 +156,20 @@ - gint id; - int port, ports = 0; - plugin_instance *instance; -- gchar *bn, *section; -+ gchar *bn, *section, *file; - -- bn = g_path_get_basename(instance->filename); -- section = g_strdup_printf("ladspa_plugin:%s:%d", bn, k); -- g_free(bn); -+ section = g_strdup_printf("ladspa_plugin%ld", k); - - aud_cfg_db_get_int(db, section, "id", &id); - aud_cfg_db_get_int(db, section, "ports", &ports); -- -- instance = add_plugin(get_plugin_by_id(id)); -+ if (!aud_cfg_db_get_string(db, section, "file", &file)) { -+ g_free(section); -+ continue; -+ } -+ bn = g_path_get_basename(file); -+ g_free(file); -+ instance = add_plugin(get_plugin_by_id(bn,id)); -+ g_free(bn); - if (!instance) - continue; /* couldn't load this plugin */ - -@@ -180,7 +183,6 @@ - } - - aud_cfg_db_close(db); --#endif - - state.initialised = TRUE; - } -@@ -222,8 +224,8 @@ - if (ladspa_path == NULL) - { - /* Fallback, look in obvious places */ -- find_plugins("/usr/lib/ladspa"); -- find_plugins("/usr/local/lib/ladspa"); -+ find_plugins("__RPM_LIBDIR__/ladspa"); -+ find_plugins("/usr/local/__RPM_LIB__/ladspa"); - } - else - { -@@ -306,7 +308,7 @@ - int port, ports = 0; - - bn = g_path_get_basename(instance->filename); -- section = g_strdup_printf("ladspa_plugin:%s:%ld", bn, instance->descriptor->UniqueID); -+ section = g_strdup_printf("ladspa_plugin%ld", plugins); - g_free(bn); - - aud_cfg_db_set_int(db, section, "id", instance->descriptor->UniqueID); -@@ -325,6 +327,7 @@ - aud_cfg_db_set_int(db, section, "ports", ports); - g_free(section); - ladspa_shutdown(instance); -+ plugins++; - } - G_UNLOCK(running_plugins); - diff --git a/audacious-plugins-2.2-ladspa.patch b/audacious-plugins-2.2-ladspa.patch new file mode 100644 index 0000000..a8d45bd --- /dev/null +++ b/audacious-plugins-2.2-ladspa.patch @@ -0,0 +1,93 @@ +diff -Nur audacious-plugins-2.2-orig/src/ladspa/ladspa.c audacious-plugins-2.2-ladspa/src/ladspa/ladspa.c +--- audacious-plugins-2.2-orig/src/ladspa/ladspa.c 2009-11-22 23:49:53.000000000 +0100 ++++ audacious-plugins-2.2-ladspa/src/ladspa/ladspa.c 2010-02-04 12:07:59.000000000 +0100 +@@ -145,7 +145,6 @@ + + static void restore(void) + { +-#if 0 + mcs_handle_t *db; + gint k, plugins = 0; + +@@ -157,16 +156,20 @@ + gint id; + int port, ports = 0; + plugin_instance *instance; +- gchar *bn, *section; ++ gchar *bn, *section, *file; + +- bn = g_path_get_basename(instance->filename); +- section = g_strdup_printf("ladspa_plugin:%s:%d", bn, k); +- g_free(bn); ++ section = g_strdup_printf("ladspa_plugin%ld", k); + + aud_cfg_db_get_int(db, section, "id", &id); + aud_cfg_db_get_int(db, section, "ports", &ports); +- +- instance = add_plugin(get_plugin_by_id(id)); ++ if (!aud_cfg_db_get_string(db, section, "file", &file)) { ++ g_free(section); ++ continue; ++ } ++ bn = g_path_get_basename(file); ++ g_free(file); ++ instance = add_plugin(get_plugin_by_id(bn,id)); ++ g_free(bn); + if (!instance) + continue; /* couldn't load this plugin */ + +@@ -180,7 +183,6 @@ + } + + aud_cfg_db_close(db); +-#endif + + state.initialised = TRUE; + } +@@ -222,8 +224,8 @@ + if (ladspa_path == NULL) + { + /* Fallback, look in obvious places */ +- find_plugins("/usr/lib/ladspa"); +- find_plugins("/usr/local/lib/ladspa"); ++ find_plugins("__RPM_LIBDIR__/ladspa"); ++ find_plugins("/usr/local/__RPM_LIB__/ladspa"); + } + else + { +@@ -306,7 +308,7 @@ + int port, ports = 0; + + bn = g_path_get_basename(instance->filename); +- section = g_strdup_printf("ladspa_plugin:%s:%ld", bn, instance->descriptor->UniqueID); ++ section = g_strdup_printf("ladspa_plugin%ld", plugins); + g_free(bn); + + aud_cfg_db_set_int(db, section, "id", instance->descriptor->UniqueID); +@@ -325,6 +327,7 @@ + aud_cfg_db_set_int(db, section, "ports", ports); + g_free(section); + ladspa_shutdown(instance); ++ plugins++; + } + G_UNLOCK(running_plugins); + +diff -Nur audacious-plugins-2.2-orig/src/ladspa/ladspa.c audacious-plugins-2.2/src/ladspa/ladspa.c +--- audacious-plugins-2.2-orig/src/ladspa/ladspa.c 2009-11-22 23:49:53.000000000 +0100 ++++ audacious-plugins-2.2/src/ladspa/ladspa.c 2010-02-04 13:18:49.000000000 +0100 +@@ -702,6 +702,7 @@ + } + + instance->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); ++ gtk_window_set_type_hint(GTK_WINDOW(instance->window), GDK_WINDOW_TYPE_HINT_DIALOG); + gtk_window_set_title(GTK_WINDOW(instance->window), plugin->Name); + + vbox = gtk_vbox_new(FALSE, 3); +@@ -1076,6 +1077,7 @@ + } + + config_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); ++ gtk_window_set_type_hint(GTK_WINDOW(config_window), GDK_WINDOW_TYPE_HINT_DIALOG); + vbox = gtk_vbox_new(FALSE, 0); + hbox = gtk_hbox_new(TRUE, 0); + diff --git a/audacious-plugins.spec b/audacious-plugins.spec index 90cc50d..7b202ee 100644 --- a/audacious-plugins.spec +++ b/audacious-plugins.spec @@ -5,7 +5,7 @@ Name: audacious-plugins Version: 2.2 -Release: 16%{?dist} +Release: 17%{?dist} Summary: Plugins for the Audacious media player Group: Applications/Multimedia URL: http://audacious-media-player.org/ @@ -49,7 +49,8 @@ Patch10: audacious-plugins-2.2-adplug-lds.patch Patch11: audacious-plugins-2.2-streambrowser-race.patch # huh? AUDPLUG-161 / bz561635 # plus: hardcoded libdir replacement -Patch12: audacious-plugins-2.2-ladspa-restore.patch +# plus: fix dialog +Patch12: audacious-plugins-2.2-ladspa.patch BuildRequires: audacious-devel >= %{aud_ver} BuildRequires: jack-audio-connection-kit-devel libsamplerate-devel @@ -191,7 +192,7 @@ in Vortex (.vtx) format. %patch9 -p1 -b .adplug-fclose %patch10 -p1 -b .lds-out-of-bounds %patch11 -p1 -b .streambrowser-race -%patch12 -p1 -b .ladspa-restore +%patch12 -p1 -b .ladspa for i in src/ladspa/ladspa.c do @@ -292,6 +293,9 @@ update-desktop-database &> /dev/null || : %changelog +* Thu Feb 4 2010 Michael Schwendt - 2.2-17 +- Fix non-top-level ladspa plugin dialogs. + * Thu Feb 4 2010 Michael Schwendt - 2.2-16 - Restore and fix the restore() function in "ladspa" plugin (#561635). - Substitute hardcoded ladspa search paths in source code.