rpms/gnome-media/devel 0001-Avoid-crashing-when-switching-profiles-quickly.patch, NONE, 1.1 gnome-media.spec, 1.178, 1.179

Bastien Nocera hadess at fedoraproject.org
Wed Sep 16 15:41:05 UTC 2009


Author: hadess

Update of /cvs/pkgs/rpms/gnome-media/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv18760

Modified Files:
	gnome-media.spec 
Added Files:
	0001-Avoid-crashing-when-switching-profiles-quickly.patch 
Log Message:
* Wed Sep 16 2009 Bastien Nocera <bnocera at redhat.com> 2.27.91-2
- Fix crashing when profile changes happen quickly (#523669)


0001-Avoid-crashing-when-switching-profiles-quickly.patch:
 gvc-mixer-card.c |   26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

--- NEW FILE 0001-Avoid-crashing-when-switching-profiles-quickly.patch ---
>From a9e56981434d3c4f760243ce7f83b64ec487f442 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess at hadess.net>
Date: Wed, 16 Sep 2009 16:36:58 +0100
Subject: [PATCH] Avoid crashing when switching profiles quickly

When switching profiles quickly, we were getting callbacks
about old operations which we're not interested in, because
they don't match the latest requested profile.

So keep track of the last requested change, and cancel already
running operations when asking for a new profile.
---
 gnome-volume-control/src/gvc-mixer-card.c |   25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/gnome-volume-control/src/gvc-mixer-card.c b/gnome-volume-control/src/gvc-mixer-card.c
index 9037ff2..dc4ccca 100644
--- a/gnome-volume-control/src/gvc-mixer-card.c
+++ b/gnome-volume-control/src/gvc-mixer-card.c
@@ -47,6 +47,7 @@ struct GvcMixerCardPrivate
         char          *target_profile;
         char          *human_profile;
         GList         *profiles;
+        pa_operation  *profile_op;
 };
 
 enum
@@ -209,6 +210,9 @@ _pa_context_set_card_profile_by_index_cb (pa_context                       *cont
         }
         g_free (card->priv->target_profile);
         card->priv->target_profile = NULL;
+
+        pa_operation_unref (card->priv->profile_op);
+        card->priv->profile_op = NULL;
 }
 
 gboolean
@@ -223,25 +227,26 @@ gvc_mixer_card_change_profile (GvcMixerCard *card,
                 return TRUE;
         if (g_strcmp0 (profile, card->priv->target_profile) == 0)
                 return TRUE;
+        if (card->priv->profile_op != NULL) {
+                pa_operation_cancel (card->priv->profile_op);
+                pa_operation_unref (card->priv->profile_op);
+                card->priv->profile_op = NULL;
+        }
 
         if (card->priv->profile != NULL) {
-                pa_operation *o;
-
                 g_free (card->priv->target_profile);
                 card->priv->target_profile = g_strdup (profile);
 
-                o = pa_context_set_card_profile_by_index (card->priv->pa_context,
-                                                          card->priv->index,
-                                                          card->priv->target_profile,
-                                                          _pa_context_set_card_profile_by_index_cb,
-                                                          card);
+                card->priv->profile_op = pa_context_set_card_profile_by_index (card->priv->pa_context,
+                                                                               card->priv->index,
+                                                                               card->priv->target_profile,
+                                                                               _pa_context_set_card_profile_by_index_cb,
+                                                                               card);
 
-                if (o == NULL) {
+                if (card->priv->profile_op == NULL) {
                         g_warning ("pa_context_set_card_profile_by_index() failed");
                         return FALSE;
                 }
-
-                pa_operation_unref (o);
         } else {
                 g_assert (card->priv->human_profile == NULL);
                 card->priv->profile = g_strdup (profile);
-- 
1.6.2.5



Index: gnome-media.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gnome-media/devel/gnome-media.spec,v
retrieving revision 1.178
retrieving revision 1.179
diff -u -p -r1.178 -r1.179
--- gnome-media.spec	7 Sep 2009 14:10:02 -0000	1.178
+++ gnome-media.spec	16 Sep 2009 15:41:05 -0000	1.179
@@ -14,10 +14,11 @@
 Summary:        GNOME media programs
 Name:           gnome-media
 Version:        2.27.91
-Release:        1%{?dist}
+Release:        2%{?dist}
 License:        GPLv2+ and GFDL
 Group:          Applications/Multimedia
 Source:         http://download.gnome.org/sources/gnome-media/2.27/gnome-media-%{version}.tar.bz2
+Patch0:         0001-Avoid-crashing-when-switching-profiles-quickly.patch
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Obsoletes:      gnome
@@ -42,7 +43,6 @@ BuildRequires:  libcanberra-devel
 BuildRequires:  pulseaudio-libs-devel
 BuildRequires:  gnome-doc-utils
 BuildRequires:  intltool
-BuildRequires:  automake autoconf libtool
 BuildRequires:  unique-devel
 
 %description
@@ -83,12 +83,11 @@ framework.
 
 %prep
 %setup -q
+%patch0 -p1 -b .profiles
 
 # force regeneration
 rm profiles/gnome-audio-profiles.schemas
 
-autoreconf -i -f
-
 %build
 # try to work around a problem where gst-inspect does
 # not find playbin the first time around
@@ -314,6 +313,9 @@ fi
 
 
 %changelog
+* Wed Sep 16 2009 Bastien Nocera <bnocera at redhat.com> 2.27.91-2
+- Fix crashing when profile changes happen quickly (#523669)
+
 * Mon Sep 07 2009 Bastien Nocera <bnocera at redhat.com> 2.27.91-1
 - Update to 2.27.91
 




More information about the fedora-extras-commits mailing list