rpms/gnome-media/F-11 gvc-set-default-output-instant.patch, NONE, 1.1 gnome-media.spec, 1.170, 1.171

Bastien Nocera hadess at fedoraproject.org
Fri May 1 16:24:10 UTC 2009


Author: hadess

Update of /cvs/pkgs/rpms/gnome-media/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv29241

Modified Files:
	gnome-media.spec 
Added Files:
	gvc-set-default-output-instant.patch 
Log Message:
* Fri May 01 2009 Bastien Nocera <bnocera at redhat.com> 2.26.0-5
- Move streams straight away when changing the default sink (#489049)

gvc-set-default-output-instant.patch:

--- NEW FILE gvc-set-default-output-instant.patch ---
diff --git a/gnome-volume-control/src/gvc-mixer-control.c b/gnome-volume-control/src/gvc-mixer-control.c
index 4ac2c6c..0ff4b9c 100644
--- a/gnome-volume-control/src/gvc-mixer-control.c
+++ b/gnome-volume-control/src/gvc-mixer-control.c
@@ -65,6 +65,8 @@ struct GvcMixerControlPrivate
         GHashTable       *sink_inputs; /* routable output streams */
         GHashTable       *source_outputs; /* routable input streams */
         GHashTable       *clients;
+
+        const char       *new_default_output; /* new default stream, used in gvc_mixer_control_set_default_sink () */
 };
 
 enum {
@@ -104,6 +106,46 @@ gvc_mixer_control_get_event_sink_input (GvcMixerControl *control)
         return stream;
 }
 
+static void
+gvc_mixer_control_stream_restore_cb (pa_context *c,
+                                     const pa_ext_stream_restore_info *info,
+                                     int eol,
+                                     void *userdata)
+{
+        pa_operation *o;
+        GvcMixerControl *control = (GvcMixerControl *) userdata;
+        pa_ext_stream_restore_info new_info;
+
+        if (eol) {
+        	control->priv->new_default_output = NULL;
+                return;
+	}
+
+	if (control->priv->new_default_output == NULL)
+		return;
+
+        new_info.name = info->name;
+        new_info.channel_map = info->channel_map;
+        new_info.volume = info->volume;
+        new_info.mute = info->mute;
+
+        new_info.device = control->priv->new_default_output;
+
+        o = pa_ext_stream_restore_write (control->priv->pa_context,
+                                         PA_UPDATE_REPLACE,
+                                         &new_info, 1,
+                                         TRUE, NULL, NULL);
+
+        if (o == NULL) {
+                g_warning ("pa_ext_stream_restore_write() failed");
+                return;
+        }
+
+        g_debug ("Changed default device for %s to %s", info->name, info->device);
+
+        pa_operation_unref (o);
+}
+
 gboolean
 gvc_mixer_control_set_default_sink (GvcMixerControl *control,
                                     GvcMixerStream  *stream)
@@ -124,6 +166,19 @@ gvc_mixer_control_set_default_sink (GvcMixerControl *control,
 
         pa_operation_unref (o);
 
+        control->priv->new_default_output = gvc_mixer_stream_get_name (stream);
+        o = pa_ext_stream_restore_read (control->priv->pa_context,
+                                        gvc_mixer_control_stream_restore_cb,
+                                        control);
+
+        if (o == NULL) {
+        	control->priv->new_default_output = NULL;
+                g_warning ("pa_ext_stream_restore_read() failed");
+                return FALSE;
+        }
+
+        pa_operation_unref (o);
+
         return TRUE;
 }
 


Index: gnome-media.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gnome-media/F-11/gnome-media.spec,v
retrieving revision 1.170
retrieving revision 1.171
diff -u -p -r1.170 -r1.171
--- gnome-media.spec	27 Apr 2009 18:32:39 -0000	1.170
+++ gnome-media.spec	1 May 2009 16:23:40 -0000	1.171
@@ -14,7 +14,7 @@
 Summary:        GNOME media programs
 Name:           gnome-media
 Version:        2.26.0
-Release:        4%{?dist}
+Release:        5%{?dist}
 License:        GPLv2+ and GFDL
 Group:          Applications/Multimedia
 Source:         http://download.gnome.org/sources/gnome-media/2.26/gnome-media-%{version}.tar.bz2
@@ -24,6 +24,9 @@ Patch3:		gnome-media-add-100-mark.patch
 Patch4: 	fix-alignment-of-sliders.patch
 # https://bugzilla.redhat.com/show_bug.cgi?id=493138
 Patch5:		0001-Don-t-show-debug-output-when-disabling-debugging.patch
+# http://bugzilla.gnome.org/show_bug.cgi?id=581024
+# https://bugzilla.redhat.com/show_bug.cgi?id=489049
+Patch6:		gvc-set-default-output-instant.patch
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Obsoletes:      gnome
@@ -85,6 +88,7 @@ pushd gnome-volume-control/src
 popd
 %patch4 -p1 -b .fix-alignment-of-sliders
 %patch5 -p1 -b .debug
+%patch6 -p1 -b .move-streams
 
 %build
 # try to work around a problem where gst-inspect does
@@ -258,6 +262,9 @@ scrollkeeper-update -q || :
 %{_libdir}/pkgconfig/*
 
 %changelog
+* Fri May 01 2009 Bastien Nocera <bnocera at redhat.com> 2.26.0-5
+- Move streams straight away when changing the default sink (#489049)
+
 * Mon Apr 27 2009 Matthias Clasen <mclasen at redhat.com> - 2.26.0-4
 - Fix alignment of sliders on the application tab as well
 




More information about the scm-commits mailing list