[pulseaudio-discuss] [PATCH] virtual: Fix volume callback setting.

Tanu Kaskinen tanuk at iki.fi
Wed Jul 20 20:50:56 PDT 2011


We want to set the volume callbacks only if volume sharing
is not used. When volume sharing is used, we don't want to
mess with the stream volumes.
---
 src/modules/module-virtual-sink.c   |    2 +-
 src/modules/module-virtual-source.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/modules/module-virtual-sink.c b/src/modules/module-virtual-sink.c
index b52a29b..0a410e4 100644
--- a/src/modules/module-virtual-sink.c
+++ b/src/modules/module-virtual-sink.c
@@ -567,7 +567,7 @@ int pa__init(pa_module*m) {
     u->sink->update_requested_latency = sink_update_requested_latency_cb;
     u->sink->request_rewind = sink_request_rewind_cb;
     pa_sink_set_set_mute_callback(u->sink, sink_set_mute_cb);
-    if (use_volume_sharing) {
+    if (!use_volume_sharing) {
         pa_sink_set_set_volume_callback(u->sink, sink_set_volume_cb);
         pa_sink_enable_decibel_volume(u->sink, TRUE);
     }
diff --git a/src/modules/module-virtual-source.c b/src/modules/module-virtual-source.c
index 7bcecfa..b7f6982 100644
--- a/src/modules/module-virtual-source.c
+++ b/src/modules/module-virtual-source.c
@@ -594,7 +594,7 @@ int pa__init(pa_module*m) {
     u->source->set_state = source_set_state_cb;
     u->source->update_requested_latency = source_update_requested_latency_cb;
     pa_source_set_set_mute_callback(u->source, source_set_mute_cb);
-    if (use_volume_sharing) {
+    if (!use_volume_sharing) {
         pa_source_set_set_volume_callback(u->source, source_set_volume_cb);
         pa_source_enable_decibel_volume(u->source, TRUE);
     }
-- 
1.7.5.4



More information about the pulseaudio-discuss mailing list