[vlc-commits] PulseAudio: set/clear mute flag if volume is zero/non-zero

Rémi Denis-Courmont git at videolan.org
Wed Apr 6 20:23:53 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Apr  6 21:23:25 2011 +0300| [a6b1b84a644f2fcdcbeaccfbc212f93e0f51c77e] | committer: Rémi Denis-Courmont

PulseAudio: set/clear mute flag if volume is zero/non-zero

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a6b1b84a644f2fcdcbeaccfbc212f93e0f51c77e
---

 modules/audio_output/pulse.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/modules/audio_output/pulse.c b/modules/audio_output/pulse.c
index 1d1f5ee..45a06db 100644
--- a/modules/audio_output/pulse.c
+++ b/modules/audio_output/pulse.c
@@ -281,11 +281,14 @@ static int VolumeSet(aout_instance_t *aout, audio_volume_t vol)
 
     pa_threaded_mainloop_lock(mainloop);
     op = pa_context_set_sink_input_volume(sys->context, idx, &cvolume, NULL, NULL);
+    if (likely(op != NULL))
+        pa_operation_unref(op);
+    op = pa_context_set_sink_input_mute(sys->context, idx, volume == PA_VOLUME_MUTED,
+                                        NULL, NULL);
+    if (likely(op != NULL))
+        pa_operation_unref(op);
     pa_threaded_mainloop_unlock(mainloop);
 
-    if (unlikely(op == NULL))
-        return -1;
-    pa_operation_unref(op);
     return 0;
 }
 



More information about the vlc-commits mailing list