summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2009-10-30 09:27:59 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-10-30 09:27:59 +0100
commit3f541452c4916b31a222043b172b3398647b8091 (patch)
tree4cae033d1bc7250bb98ceaf16ec663722a090ea7
parent0c12f585e3b4d8ecb1f52bfcb5dca2b57c71cf44 (diff)
pulsesink: Only set the volume on stream connection if pulse >= 0.9.20 is available
In older versions the volume set during stream connection had no defined sematic and usually it was a relative volume. What was needed for our use case is an absolute volume though, otherwise the volume will be always decreased on stream connection if it's less than 100%. Since pulse 0.9.20 that volume is always an absolute volume if flat volumes are used and relative otherwise, which is the same as for pa_context_set_sink_input_volume(). Relevant pulse changesets: http://git.0pointer.de/?p=pulseaudio.git;a=commit;h=f27a50691c8fe45bac7dd6b21fac91a359def3a1 http://git.0pointer.de/?p=pulseaudio.git;a=commit;h=2501687579e359d5032a4d165b2ffc8f5b1b8ba6
-rw-r--r--configure.ac4
-rw-r--r--ext/pulse/pulsesink.c7
2 files changed, 10 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 36b388480..0e6d63cbc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -772,6 +772,10 @@ AG_GST_CHECK_FEATURE(PULSE, [pulseaudio plug-in], pulseaudio, [
if test x$HAVE_PULSE_0_9_15 = xyes; then
AC_DEFINE(HAVE_PULSE_0_9_15, 1, [defined if pulseaudio >= 0.9.15 is available])
fi
+ AG_GST_PKG_CHECK_MODULES(PULSE_0_9_20, libpulse >= 0.9.20)
+ if test x$HAVE_PULSE_0_9_20 = xyes; then
+ AC_DEFINE(HAVE_PULSE_0_9_20, 1, [defined if pulseaudio >= 0.9.20 is available])
+ fi
])
dnl *** dv1394 ***
diff --git a/ext/pulse/pulsesink.c b/ext/pulse/pulsesink.c
index f1907fe2e..45c36652c 100644
--- a/ext/pulse/pulsesink.c
+++ b/ext/pulse/pulsesink.c
@@ -606,7 +606,10 @@ gst_pulseringbuffer_acquire (GstRingBuffer * buf, GstRingBufferSpec * spec)
const pa_buffer_attr *actual;
pa_channel_map channel_map;
pa_operation *o = NULL;
- pa_cvolume v, *pv;
+#if HAVE_PULSE_0_9_20
+ pa_cvolume v;
+#endif
+ pa_cvolume *pv = NULL;
pa_stream_flags_t flags;
const gchar *name;
GstAudioClock *clock;
@@ -677,6 +680,7 @@ gst_pulseringbuffer_acquire (GstRingBuffer * buf, GstRingBufferSpec * spec)
GST_INFO_OBJECT (psink, "prebuf: %d", wanted.prebuf);
GST_INFO_OBJECT (psink, "minreq: %d", wanted.minreq);
+#if HAVE_PULSE_0_9_20
/* configure volume when we changed it, else we leave the default */
if (psink->volume_set) {
GST_LOG_OBJECT (psink, "have volume of %f", psink->volume);
@@ -686,6 +690,7 @@ gst_pulseringbuffer_acquire (GstRingBuffer * buf, GstRingBufferSpec * spec)
} else {
pv = NULL;
}
+#endif
/* construct the flags */
flags = PA_STREAM_INTERPOLATE_TIMING | PA_STREAM_AUTO_TIMING_UPDATE |