[Spice-devel] [spice-gtk PATCH] audio: keep compatibility with old pulse version

Victor Toso victortoso at redhat.com
Tue Mar 31 09:57:14 PDT 2015


The commit 9ef68ecd1fd11dea626628 breaks compatibility with old versions
of libpulse as the source_output functions were available from version
1.0.0 onwards.
---
 gtk/spice-pulse.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gtk/spice-pulse.c b/gtk/spice-pulse.c
index dd7f309..c583032 100644
--- a/gtk/spice-pulse.c
+++ b/gtk/spice-pulse.c
@@ -672,8 +672,13 @@ static void record_mute_changed(GObject *object, GParamSpec *pspec, gpointer dat
         pa_stream_get_device_index(p->record.stream) == PA_INVALID_INDEX)
         return;
 
+#if PA_CHECK_VERSION(1,0,0)
     op = pa_context_set_source_output_mute(p->context,
         pa_stream_get_index(p->record.stream),
+#else
+    op = pa_context_set_source_mute_by_index(p->context,
+        pa_stream_get_device_index(p->record.stream),
+#endif
         mute, NULL, NULL);
     if (!op)
         g_warning("set_source_output_mute() failed: %s",
@@ -708,8 +713,13 @@ static void record_volume_changed(GObject *object, GParamSpec *pspec, gpointer d
         pa_stream_get_device_index(p->record.stream) == PA_INVALID_INDEX)
         return;
 
+#if PA_CHECK_VERSION(1,0,0)
     op = pa_context_set_source_output_volume(p->context,
         pa_stream_get_index(p->record.stream),
+#else
+    op = pa_context_set_source_volume_by_index(p->context,
+        pa_stream_get_device_index(p->record.stream),
+#endif
         &v, NULL, NULL);
     if (!op)
         g_warning("set_source_output_volume() failed: %s",
-- 
2.1.0



More information about the Spice-devel mailing list