virtual: Fix volume callback setting.
authorTanu Kaskinen <tanuk@iki.fi>
Thu, 21 Jul 2011 03:50:56 +0000 (06:50 +0300)
committerColin Guthrie <colin@mageia.org>
Thu, 21 Jul 2011 19:38:57 +0000 (20:38 +0100)
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.

This was broken in 6c6b50

src/modules/module-virtual-sink.c
src/modules/module-virtual-source.c

index b52a29b..0a410e4 100644 (file)
@@ -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);
     }
index 7bcecfa..b7f6982 100644 (file)
@@ -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);
     }