rpms/gstreamer-plugins-good/F-11 pulsesink-lowering-volumes.patch, NONE, 1.1 gstreamer-plugins-good.spec, 1.100, 1.101

Bastien Nocera hadess at fedoraproject.org
Sat Oct 17 00:50:46 UTC 2009


Author: hadess

Update of /cvs/pkgs/rpms/gstreamer-plugins-good/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv9073

Modified Files:
	gstreamer-plugins-good.spec 
Added Files:
	pulsesink-lowering-volumes.patch 
Log Message:
* Sat Oct 17 2009 Bastien Nocera <bnocera at redhat.com> 0.10.16-3
- Finally fix pulsesink volume lowering problems (#488532)


pulsesink-lowering-volumes.patch:
 pulsesink.c |   35 ++++++++++++++++++++---------------
 1 file changed, 20 insertions(+), 15 deletions(-)

--- NEW FILE pulsesink-lowering-volumes.patch ---
>From cee7048dcd68f1d3cca3651a5aaef11145390fa4 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart at poettering.net>
Date: Sat, 17 Oct 2009 02:18:53 +0200
Subject: [PATCH] pulse: never apply volume more than once

Generally decisions on the volume of the stream should be done inside of
PA, not inside of Gst. Only PA knows how volumes translate between
devices and s on.

This patch makes sure that all volumes set via the volume property are
only applied *once* to the underlying stream. After applying them the
client side will not store them anymore. This should make sure that
really only user-triggered volume changes are forwarded to server, but
the client never tries to save/restore the volume internally.
---
 ext/pulse/pulsesink.c |   34 ++++++++++++++++++++--------------
 1 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/ext/pulse/pulsesink.c b/ext/pulse/pulsesink.c
index dd47c33..1fe2b72 100644
--- a/ext/pulse/pulsesink.c
+++ b/ext/pulse/pulsesink.c
@@ -730,6 +730,10 @@ gst_pulseringbuffer_acquire (GstRingBuffer * buf, GstRingBufferSpec * spec)
     pa_threaded_mainloop_wait (psink->mainloop);
   }
 
+  /* After we passed the volume off of to PA we never want to set it
+     again, since it is PA's job to save/restore volumes.  */
+  psink->volume_set = psink->mute_set = FALSE;
+
   GST_LOG_OBJECT (psink, "stream is acquired now");
 
   /* get the actual buffering properties now */
@@ -1527,8 +1531,8 @@ gst_pulsesink_class_init (GstPulseSinkClass * klass)
   g_object_class_install_property (gobject_class,
       PROP_VOLUME,
       g_param_spec_double ("volume", "Volume",
-          "Volume of this stream, 1.0=100%", 0.0, MAX_VOLUME, DEFAULT_VOLUME,
-          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+          "Linear volume of this stream, 1.0=100%", 0.0, MAX_VOLUME,
+          DEFAULT_VOLUME, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
   g_object_class_install_property (gobject_class,
       PROP_MUTE,
       g_param_spec_boolean ("mute", "Mute",
@@ -1588,10 +1592,10 @@ gst_pulsesink_init (GstPulseSink * pulsesink, GstPulseSinkClass * klass)
   pulsesink->device = NULL;
   pulsesink->device_description = NULL;
 
-  pulsesink->volume = 1.0;
+  pulsesink->volume = DEFAULT_VOLUME;
   pulsesink->volume_set = FALSE;
 
-  pulsesink->mute = FALSE;
+  pulsesink->mute = DEFAULT_MUTE;
   pulsesink->mute_set = FALSE;
 
   pulsesink->notify = 0;
@@ -1654,9 +1658,6 @@ gst_pulsesink_set_volume (GstPulseSink * psink, gdouble volume)
 
   GST_DEBUG_OBJECT (psink, "setting volume to %f", volume);
 
-  psink->volume = volume;
-  psink->volume_set = TRUE;
-
   pbuf = GST_PULSERING_BUFFER_CAST (GST_BASE_AUDIO_SINK (psink)->ringbuffer);
   if (pbuf == NULL || pbuf->stream == NULL)
     goto no_buffer;
@@ -1683,6 +1684,9 @@ unlock:
   /* ERRORS */
 no_buffer:
   {
+    psink->volume = volume;
+    psink->volume_set = TRUE;
+
     GST_DEBUG_OBJECT (psink, "we have no ringbuffer");
     goto unlock;
   }
@@ -1711,9 +1715,6 @@ gst_pulsesink_set_mute (GstPulseSink * psink, gboolean mute)
 
   GST_DEBUG_OBJECT (psink, "setting mute state to %d", mute);
 
-  psink->mute = mute;
-  psink->mute_set = TRUE;
-
   pbuf = GST_PULSERING_BUFFER_CAST (GST_BASE_AUDIO_SINK (psink)->ringbuffer);
   if (pbuf == NULL || pbuf->stream == NULL)
     goto no_buffer;
@@ -1738,6 +1739,9 @@ unlock:
   /* ERRORS */
 no_buffer:
   {
+    psink->mute = mute;
+    psink->mute_set = TRUE;
+
     GST_DEBUG_OBJECT (psink, "we have no ringbuffer");
     goto unlock;
   }
@@ -1788,7 +1792,7 @@ gst_pulsesink_get_volume (GstPulseSink * psink)
 {
   GstPulseRingBuffer *pbuf;
   pa_operation *o = NULL;
-  gdouble v;
+  gdouble v = DEFAULT_VOLUME;
   uint32_t idx;
 
   pa_threaded_mainloop_lock (psink->mainloop);
@@ -1810,11 +1814,12 @@ gst_pulsesink_get_volume (GstPulseSink * psink)
       goto unlock;
   }
 
+  v = psink->volume;
+
 unlock:
   if (o)
     pa_operation_unref (o);
 
-  v = psink->volume;
   pa_threaded_mainloop_unlock (psink->mainloop);
 
   if (v > MAX_VOLUME) {
@@ -1850,7 +1855,7 @@ gst_pulsesink_get_mute (GstPulseSink * psink)
   GstPulseRingBuffer *pbuf;
   pa_operation *o = NULL;
   uint32_t idx;
-  gboolean mute;
+  gboolean mute = FALSE;
 
   pa_threaded_mainloop_lock (psink->mainloop);
 
@@ -1871,11 +1876,12 @@ gst_pulsesink_get_mute (GstPulseSink * psink)
       goto unlock;
   }
 
+  mute = psink->mute;
+
 unlock:
   if (o)
     pa_operation_unref (o);
 
-  mute = psink->mute;
   pa_threaded_mainloop_unlock (psink->mainloop);
 
   return mute;
-- 
1.6.3.3



Index: gstreamer-plugins-good.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gstreamer-plugins-good/F-11/gstreamer-plugins-good.spec,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -p -r1.100 -r1.101
--- gstreamer-plugins-good.spec	16 Oct 2009 14:46:53 -0000	1.100
+++ gstreamer-plugins-good.spec	17 Oct 2009 00:50:45 -0000	1.101
@@ -6,7 +6,7 @@
 
 Name: 		%{gstreamer}-plugins-good
 Version: 	0.10.16
-Release:  	2%{?dist}
+Release:  	3%{?dist}
 Summary: 	GStreamer plug-ins with good code and licensing
 
 Group: 		Applications/Multimedia
@@ -73,6 +73,9 @@ BuildRequires: automake autoconf libtool
 Provides: gstreamer-plugins-farsight = 0.12.12-1
 Obsoletes: gstreamer-plugins-farsight < 0.12.12
 
+# http://bugzilla.gnome.org/show_bug.cgi?id=595231
+Patch2: pulsesink-lowering-volumes.patch
+
 %description
 GStreamer is a streaming media framework, based on graphs of filters which
 operate on media data. Applications using this library can do anything
@@ -111,6 +114,7 @@ This is a dummy package to make gstreame
 %patch1 -p1 -b .autoconvert-caps
 libtoolize -f
 autoreconf
+%patch2 -p1 -b .volume-lowering
 
 %build
 
@@ -274,6 +278,9 @@ export GCONF_CONFIG_SOURCE=`gconftool-2 
 gconftool-2 --makefile-install-rule %{_sysconfdir}/gconf/schemas/gstreamer-%{majorminor}.schemas > /dev/null || :
 
 %changelog
+* Sat Oct 17 2009 Bastien Nocera <bnocera at redhat.com> 0.10.16-3
+- Finally fix pulsesink volume lowering problems (#488532)
+
 * Fri Oct 16 2009 Bastien Nocera <bnocera at redhat.com> 0.10.16-2
 - Fix autoconvert caps negotiation
 




More information about the fedora-extras-commits mailing list