summaryrefslogtreecommitdiff
path: root/src/modules/alsa/alsa-sink.c
diff options
context:
space:
mode:
authorDavid Henningsson <david.henningsson@canonical.com>2012-04-03 21:35:07 +0200
committerDavid Henningsson <david.henningsson@canonical.com>2012-04-04 14:36:43 +0200
commit87edc1ccb0846066424f9158acd8fb9e089db0e5 (patch)
treed57e98e67b27f6d6ae90e18f20a05ed7cdaa1900 /src/modules/alsa/alsa-sink.c
parente815a1f81a5a018f8d7c8f6be7f93e600606ed24 (diff)
downloadpulseaudio-87edc1ccb0846066424f9158acd8fb9e089db0e5.tar.gz
alsa-sink/source: Really set volumes on port change
If deferred volumes were activated, set_volume does not really set the volume, and is probably only meant to be called from the main thread. As we're currently really setting the port and the mute here (i e modifying ALSA), we should really modify the volume as well. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Diffstat (limited to 'src/modules/alsa/alsa-sink.c')
-rw-r--r--src/modules/alsa/alsa-sink.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index ea5188c9e..65f12c21b 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -1465,8 +1465,13 @@ static int sink_set_port_cb(pa_sink *s, pa_device_port *p) {
if (s->set_mute)
s->set_mute(s);
- if (s->set_volume)
- s->set_volume(s);
+ if (s->flags & PA_SINK_DEFERRED_VOLUME) {
+ if (s->write_volume)
+ s->write_volume(s);
+ } else {
+ if (s->set_volume)
+ s->set_volume(s);
+ }
return 0;
}