summaryrefslogtreecommitdiff
path: root/ext
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 /ext
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
Diffstat (limited to 'ext')
-rw-r--r--ext/pulse/pulsesink.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/pulse/pulsesink.c b/ext/pulse/pulsesink.c
index f1907fe2..45c36652 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 |