diff options
author | Nirbheek Chauhan <nirbheek@gentoo.org> | 2009-09-12 11:38:19 +0000 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@gentoo.org> | 2009-09-12 11:38:19 +0000 |
commit | 228842da6888ca42a91655b11488a505f31bf579 (patch) | |
tree | f35ef601292481bbf58d64bdae3e5022d9d2bea0 /gnome-extra/gnome-media | |
parent | amd64 stable (diff) | |
download | historical-228842da6888ca42a91655b11488a505f31bf579.tar.gz historical-228842da6888ca42a91655b11488a505f31bf579.tar.bz2 historical-228842da6888ca42a91655b11488a505f31bf579.zip |
First half of fix for bug 274819 (second half will go to gnome-settings-daemon) -- restarting pulseaudio breaks volume applet
Package-Manager: portage-2.2_rc40/cvs/Linux i686
Diffstat (limited to 'gnome-extra/gnome-media')
-rw-r--r-- | gnome-extra/gnome-media/ChangeLog | 10 | ||||
-rw-r--r-- | gnome-extra/gnome-media/Manifest | 15 | ||||
-rw-r--r-- | gnome-extra/gnome-media/files/gnome-media-2.26.0-connection-failed-pulseaudio.patch | 321 | ||||
-rw-r--r-- | gnome-extra/gnome-media/gnome-media-2.26.0-r1.ebuild (renamed from gnome-extra/gnome-media/gnome-media-2.26.0.ebuild) | 6 |
4 files changed, 338 insertions, 14 deletions
diff --git a/gnome-extra/gnome-media/ChangeLog b/gnome-extra/gnome-media/ChangeLog index 4902cf9a435a..662a96f727bb 100644 --- a/gnome-extra/gnome-media/ChangeLog +++ b/gnome-extra/gnome-media/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for gnome-extra/gnome-media # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/gnome-extra/gnome-media/ChangeLog,v 1.199 2009/08/23 21:48:12 eva Exp $ +# $Header: /var/cvsroot/gentoo-x86/gnome-extra/gnome-media/ChangeLog,v 1.200 2009/09/12 11:38:18 nirbheek Exp $ + +*gnome-media-2.26.0-r1 (12 Sep 2009) + + 12 Sep 2009; Nirbheek Chauhan <nirbheek@gentoo.org> + -gnome-media-2.26.0.ebuild, +gnome-media-2.26.0-r1.ebuild, + +files/gnome-media-2.26.0-connection-failed-pulseaudio.patch: + First half of fix for bug 274819 (second half will go to + gnome-settings-daemon) -- restarting pulseaudio breaks volume applet 23 Aug 2009; Gilles Dartiguelongue <eva@gentoo.org> gnome-media-2.26.0.ebuild: diff --git a/gnome-extra/gnome-media/Manifest b/gnome-extra/gnome-media/Manifest index dc8c7ff62a03..a5c37e335da7 100644 --- a/gnome-extra/gnome-media/Manifest +++ b/gnome-extra/gnome-media/Manifest @@ -1,18 +1,9 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 - AUX gnome-media-2.26.0-automagic-canberra.patch 5039 RMD160 8d5b3e756ad5356c45fc930dc0154075521f7377 SHA1 fa1806db43e539549912c3f63ad5ed471417c077 SHA256 f80d00374c8d409c8f4d37812b20644c0e64a3525af843b445d3695933610c00 +AUX gnome-media-2.26.0-connection-failed-pulseaudio.patch 11836 RMD160 cd79ee85240c24bf1c37acbef45c9bf466e11d94 SHA1 22dee433e50c4ac7c43ccf3b771018d0518bf13d SHA256 1b5307eb87975117582a99e53998af08a24a14ef62de0343e27c18a7f179145b AUX gnome-media-2.26.0-missing-cddbslave-cflags.patch 764 RMD160 5d788ac6ac1d0bad8907afb359334900b3ef520d SHA1 6daf0b299767b3feea72b320c2be308de667f2f9 SHA256 3b15659c984d623ae440d35cd0f7f1e7389774412f4e3d2bb34fa9efe09a58db DIST gnome-media-2.24.0.1.tar.bz2 2344888 RMD160 695f4cf9b170a381c243846749f5fad916f8bbca SHA1 2704b4cd13b7f776a358e517a5baf5d97455b85b SHA256 bfa79a9bea5ba6f73a6b0a232917bc7eefbed69819e42d0b09372b0c7ed3e853 DIST gnome-media-2.26.0.tar.bz2 2662523 RMD160 0720cf0394148d8dc3cf6423a8b817a70f1486ed SHA1 23ec588fdf5df3eef542278952fe78ed032d354a SHA256 39e7646d0790e05a010da1eb2d7552dcb5311abd72f001477c9c465d7146b9f7 EBUILD gnome-media-2.24.0.1-r1.ebuild 1928 RMD160 a06dec7d10019d242319d4b209999ccc92f4e7e5 SHA1 8c11f47118f75b25e69065f9a4f363daa859d6ac SHA256 df90a112dfa1f61586c940c4029dcb0682e67b01d30f1ba4275435e6a9d2c5ea -EBUILD gnome-media-2.26.0.ebuild 2678 RMD160 884aa9014b936d070458b81dbedd711a3913cecd SHA1 faa597c6513a9e5ae152d36bf9a48dc0ff48ffb4 SHA256 5fafc599537007c2ce8786931d8053d95a98f24ca7f298659bb8bebd87a74473 -MISC ChangeLog 25274 RMD160 8cc744af02f37d97c0ef83595f8a5f345cc3b4ac SHA1 194c5dcba68daf50b4fff6305d7ca8ebae52d4e3 SHA256 53e8005d8031c8b59c346c2f3544a3a1ce1970282fb7fd70126f47e19341b783 +EBUILD gnome-media-2.26.0-r1.ebuild 2837 RMD160 d80511076998c2b9b7e5dd95b76c85f1fb8f1377 SHA1 362abd833bb86c6fff1e3edf5fceb385c9e914f6 SHA256 10b824707febcb0500b190ba320cbefe847e1dc1de21b0d92b1be2d2caf20d8c +MISC ChangeLog 25627 RMD160 75225a95a3074fd0ba74adc17914a7e76cc22e1c SHA1 719102dbd3561a1ab30f4e5f5c26d8fbe109c3aa SHA256 05bcfd289afa171ce571c3c4aaccac9b4b5c45a5b4001900630744e39d0aab57 MISC metadata.xml 339 RMD160 bbf6402aadd2e37cf510214bd63b56627d88c19a SHA1 c1844224e92e5f691b8f59c9811bb8fe35751932 SHA256 0c92a127c7c041ad9eb833dc79524111e674facc15bd482f4ac0eb048f7d63f1 ------BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.11 (GNU/Linux) - -iEYEARECAAYFAkqRuSwACgkQ1fmVwcYIWAZDygCgnUNOGGdTcOwBVnbv8+SuaWqN -Y3kAoOUJ7CBK3YlE4v/l0tpkllx8tPaF -=wNT7 ------END PGP SIGNATURE----- diff --git a/gnome-extra/gnome-media/files/gnome-media-2.26.0-connection-failed-pulseaudio.patch b/gnome-extra/gnome-media/files/gnome-media-2.26.0-connection-failed-pulseaudio.patch new file mode 100644 index 000000000000..f49d2c4b6732 --- /dev/null +++ b/gnome-extra/gnome-media/files/gnome-media-2.26.0-connection-failed-pulseaudio.patch @@ -0,0 +1,321 @@ +This is taken from upstreams's git repository and is half the fix for bug 274819 +The other half is to be applied to gnome-settings-daemon (which handles the +keybindings) + +--- +From 445e8ff0b2675fe7907b700ebd4c5e9b4251ab73 Mon Sep 17 00:00:00 2001 +From: Marc-André Lureau <marcandre.lureau@gmail.com> +Date: Sun, 14 Jun 2009 20:25:14 +0000 +Subject: Bug 564311 – "Connection failed" when PA drops off + +--- +diff --git a/gnome-volume-control/src/dialog-main.c b/gnome-volume-control/src/dialog-main.c +index dddc281..dd24472 100644 +--- a/gnome-volume-control/src/dialog-main.c ++++ b/gnome-volume-control/src/dialog-main.c +@@ -85,6 +85,9 @@ on_control_ready (GvcMixerControl *control, + warning_dialog = NULL; + } + ++ if (dialog) ++ return; ++ + dialog = GTK_WIDGET (gvc_mixer_dialog_new (control)); + g_signal_connect (dialog, + "response", +@@ -115,7 +118,7 @@ warning_dialog_answered (GtkDialog *d, + static gboolean + dialog_popup_timeout (gpointer data) + { +- warning_dialog = gtk_message_dialog_new (NULL, ++ warning_dialog = gtk_message_dialog_new (GTK_WINDOW(dialog), + 0, + GTK_MESSAGE_INFO, + GTK_BUTTONS_CANCEL, +@@ -130,6 +133,18 @@ dialog_popup_timeout (gpointer data) + return FALSE; + } + ++static void ++on_control_connecting (GvcMixerControl *control, ++ UniqueApp *app) ++{ ++ if (popup_id != 0) ++ return; ++ ++ popup_id = g_timeout_add_seconds (DIALOG_POPUP_TIMEOUT, ++ dialog_popup_timeout, ++ NULL); ++} ++ + int + main (int argc, char **argv) + { +@@ -177,15 +192,15 @@ main (int argc, char **argv) + + control = gvc_mixer_control_new (); + g_signal_connect (control, ++ "connecting", ++ G_CALLBACK (on_control_connecting), ++ app); ++ g_signal_connect (control, + "ready", + G_CALLBACK (on_control_ready), + app); + gvc_mixer_control_open (control); + +- popup_id = g_timeout_add_seconds (DIALOG_POPUP_TIMEOUT, +- dialog_popup_timeout, +- NULL); +- + gtk_main (); + + if (control != NULL) { +diff --git a/gnome-volume-control/src/gvc-applet.c b/gnome-volume-control/src/gvc-applet.c +index e11818b..82e3765 100644 +--- a/gnome-volume-control/src/gvc-applet.c ++++ b/gnome-volume-control/src/gvc-applet.c +@@ -167,6 +167,13 @@ on_control_ready (GvcMixerControl *control, + } + + static void ++on_control_connecting (GvcMixerControl *control, ++ GvcApplet *applet) ++{ ++ g_debug ("Connecting.."); ++} ++ ++static void + on_control_default_sink_changed (GvcMixerControl *control, + guint id, + GvcApplet *applet) +@@ -216,6 +223,10 @@ gvc_applet_constructor (GType type, + G_CALLBACK (on_control_ready), + self); + g_signal_connect (self->priv->control, ++ "connecting", ++ G_CALLBACK (on_control_connecting), ++ self); ++ g_signal_connect (self->priv->control, + "default-sink-changed", + G_CALLBACK (on_control_default_sink_changed), + self); +diff --git a/gnome-volume-control/src/gvc-mixer-control.c b/gnome-volume-control/src/gvc-mixer-control.c +index b642467..92b0286 100644 +--- a/gnome-volume-control/src/gvc-mixer-control.c ++++ b/gnome-volume-control/src/gvc-mixer-control.c +@@ -48,6 +48,7 @@ struct GvcMixerControlPrivate + pa_mainloop_api *pa_api; + pa_context *pa_context; + int n_outstanding; ++ guint reconnect_id; + + gboolean default_sink_is_set; + guint default_sink_id; +@@ -70,6 +71,7 @@ struct GvcMixerControlPrivate + }; + + enum { ++ CONNECTING, + READY, + STREAM_ADDED, + STREAM_REMOVED, +@@ -381,12 +383,14 @@ _set_default_source (GvcMixerControl *control, + { + guint new_id; + +- new_id = 0; +- +- if (stream != NULL) { +- new_id = gvc_mixer_stream_get_id (stream); ++ if (stream == NULL) { ++ control->priv->default_source_id = 0; ++ control->priv->default_source_is_set = FALSE; ++ return; + } + ++ new_id = gvc_mixer_stream_get_id (stream); ++ + if (control->priv->default_source_id != new_id) { + control->priv->default_source_id = new_id; + control->priv->default_source_is_set = TRUE; +@@ -403,12 +407,14 @@ _set_default_sink (GvcMixerControl *control, + { + guint new_id; + +- new_id = 0; +- +- if (stream != NULL) { +- new_id = gvc_mixer_stream_get_id (stream); ++ if (stream == NULL) { ++ control->priv->default_sink_id = 0; ++ control->priv->default_sink_is_set = FALSE; ++ return; + } + ++ new_id = gvc_mixer_stream_get_id (stream); ++ + if (control->priv->default_sink_id != new_id) { + control->priv->default_sink_id = new_id; + control->priv->default_sink_is_set = TRUE; +@@ -1451,6 +1457,78 @@ gvc_mixer_control_ready (GvcMixerControl *control) + } + + static void ++gvc_mixer_new_pa_context (GvcMixerControl *self) ++{ ++ pa_proplist *proplist; ++ ++ g_return_if_fail (self); ++ g_return_if_fail (!self->priv->pa_context); ++ ++ /* FIXME: read these from an object property */ ++ proplist = pa_proplist_new (); ++ pa_proplist_sets (proplist, ++ PA_PROP_APPLICATION_NAME, ++ _("GNOME Volume Control")); ++ pa_proplist_sets (proplist, ++ PA_PROP_APPLICATION_ID, ++ "org.gnome.VolumeControl"); ++ pa_proplist_sets (proplist, ++ PA_PROP_APPLICATION_ICON_NAME, ++ "multimedia-volume-control"); ++ pa_proplist_sets (proplist, ++ PA_PROP_APPLICATION_VERSION, ++ PACKAGE_VERSION); ++ ++ self->priv->pa_context = pa_context_new_with_proplist (self->priv->pa_api, NULL, proplist); ++ ++ pa_proplist_free (proplist); ++ g_assert (self->priv->pa_context); ++} ++ ++static void ++remove_all_streams (GvcMixerControl *control, GHashTable *hash_table) ++{ ++ GHashTableIter iter; ++ gpointer key, value; ++ ++ g_hash_table_iter_init (&iter, hash_table); ++ while (g_hash_table_iter_next (&iter, &key, &value)) { ++ remove_stream (control, value); ++ g_hash_table_iter_remove (&iter); ++ } ++} ++ ++static gboolean ++idle_reconnect (gpointer data) ++{ ++ GvcMixerControl *control = GVC_MIXER_CONTROL (data); ++ GHashTableIter iter; ++ gpointer key, value; ++ ++ g_return_val_if_fail (control, FALSE); ++ ++ if (control->priv->pa_context) { ++ pa_context_unref (control->priv->pa_context); ++ control->priv->pa_context = NULL; ++ gvc_mixer_new_pa_context (control); ++ } ++ ++ remove_all_streams (control, control->priv->sinks); ++ remove_all_streams (control, control->priv->sources); ++ remove_all_streams (control, control->priv->sink_inputs); ++ remove_all_streams (control, control->priv->source_outputs); ++ ++ g_hash_table_iter_init (&iter, control->priv->clients); ++ while (g_hash_table_iter_next (&iter, &key, &value)) ++ g_hash_table_iter_remove (&iter); ++ ++ gvc_mixer_control_open (control); /* cannot fail */ ++ ++ control->priv->reconnect_id = 0; ++ return FALSE; ++} ++ ++static void + _pa_context_state_cb (pa_context *context, + void *userdata) + { +@@ -1468,7 +1546,9 @@ _pa_context_state_cb (pa_context *context, + break; + + case PA_CONTEXT_FAILED: +- g_warning ("Connection failed"); ++ g_warning ("Connection failed, reconnecting..."); ++ if (control->priv->reconnect_id == 0) ++ control->priv->reconnect_id = g_idle_add (idle_reconnect, control); + break; + + case PA_CONTEXT_TERMINATED: +@@ -1491,7 +1571,8 @@ gvc_mixer_control_open (GvcMixerControl *control) + _pa_context_state_cb, + control); + +- res = pa_context_connect (control->priv->pa_context, NULL, (pa_context_flags_t) 0, NULL); ++ g_signal_emit (G_OBJECT (control), signals[CONNECTING], 0); ++ res = pa_context_connect (control->priv->pa_context, NULL, (pa_context_flags_t) PA_CONTEXT_NOFAIL, NULL); + if (res < 0) { + g_warning ("Failed to connect context: %s", + pa_strerror (pa_context_errno (control->priv->pa_context))); +@@ -1570,30 +1651,12 @@ gvc_mixer_control_constructor (GType type, + { + GObject *object; + GvcMixerControl *self; +- pa_proplist *proplist; + + object = G_OBJECT_CLASS (gvc_mixer_control_parent_class)->constructor (type, n_construct_properties, construct_params); + + self = GVC_MIXER_CONTROL (object); + +- /* FIXME: read these from an object property */ +- proplist = pa_proplist_new (); +- pa_proplist_sets (proplist, +- PA_PROP_APPLICATION_NAME, +- _("GNOME Volume Control")); +- pa_proplist_sets (proplist, +- PA_PROP_APPLICATION_ID, +- "org.gnome.VolumeControl"); +- pa_proplist_sets (proplist, +- PA_PROP_APPLICATION_ICON_NAME, +- "multimedia-volume-control"); +- pa_proplist_sets (proplist, +- PA_PROP_APPLICATION_VERSION, +- PACKAGE_VERSION); +- +- self->priv->pa_context = pa_context_new_with_proplist (self->priv->pa_api, NULL, proplist); +- g_assert (self->priv->pa_context); +- pa_proplist_free (proplist); ++ gvc_mixer_new_pa_context (self); + + return object; + } +@@ -1607,6 +1670,14 @@ gvc_mixer_control_class_init (GvcMixerControlClass *klass) + object_class->dispose = gvc_mixer_control_dispose; + object_class->finalize = gvc_mixer_control_finalize; + ++ signals [CONNECTING] = ++ g_signal_new ("connecting", ++ G_TYPE_FROM_CLASS (klass), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (GvcMixerControlClass, connecting), ++ NULL, NULL, ++ g_cclosure_marshal_VOID__VOID, ++ G_TYPE_NONE, 0); + signals [READY] = + g_signal_new ("ready", + G_TYPE_FROM_CLASS (klass), +diff --git a/gnome-volume-control/src/gvc-mixer-control.h b/gnome-volume-control/src/gvc-mixer-control.h +index 33e745a..3de9e62 100644 +--- a/gnome-volume-control/src/gvc-mixer-control.h ++++ b/gnome-volume-control/src/gvc-mixer-control.h +@@ -46,6 +46,7 @@ typedef struct + { + GObjectClass parent_class; + ++ void (*connecting) (GvcMixerControl *control); + void (*ready) (GvcMixerControl *control); + void (*stream_added) (GvcMixerControl *control, + guint id); +-- +cgit v0.8.2 diff --git a/gnome-extra/gnome-media/gnome-media-2.26.0.ebuild b/gnome-extra/gnome-media/gnome-media-2.26.0-r1.ebuild index 3bcfb5bc310d..285e12cbc498 100644 --- a/gnome-extra/gnome-media/gnome-media-2.26.0.ebuild +++ b/gnome-extra/gnome-media/gnome-media-2.26.0-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/gnome-extra/gnome-media/gnome-media-2.26.0.ebuild,v 1.5 2009/08/23 21:48:12 eva Exp $ +# $Header: /var/cvsroot/gentoo-x86/gnome-extra/gnome-media/gnome-media-2.26.0-r1.ebuild,v 1.1 2009/09/12 11:38:18 nirbheek Exp $ EAPI="2" @@ -73,6 +73,10 @@ src_prepare() { if use gnomecd; then epatch "${FILESDIR}/${P}-missing-cddbslave-cflags.patch" fi + + # Half-fix bug 274819 -- applet does not work when PA restarts (not needed with 2.28) + epatch "${FILESDIR}/${P}-connection-failed-pulseaudio.patch" + # Fix automagic canberra support epatch "${FILESDIR}/${P}-automagic-canberra.patch" eautoreconf |