summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-01-13 20:30:36 +0100
committerLennart Poettering <lennart@poettering.net>2010-01-13 20:30:36 +0100
commit540ec7b961256d6c7702448ca995f61268064190 (patch)
tree70e812b0e077af6651341ba4ce5674c7e5e5c7a1 /src
parent9b37dce4223aaf7a5f48b04b52c89b46ad97cf73 (diff)
alsa: ignore volume changes from the hw if we are not on the active console
Diffstat (limited to 'src')
-rw-r--r--src/modules/alsa/alsa-sink.c3
-rw-r--r--src/modules/alsa/alsa-source.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index ed16c834..690480f7 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -1103,6 +1103,9 @@ static int mixer_callback(snd_mixer_elem_t *elem, unsigned int mask) {
if (mask == SND_CTL_EVENT_MASK_REMOVE)
return 0;
+ if (u->sink->suspend_cause & PA_SUSPEND_SESSION)
+ return 0;
+
if (mask & SND_CTL_EVENT_MASK_VALUE) {
pa_sink_get_volume(u->sink, TRUE);
pa_sink_get_mute(u->sink, TRUE);
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index 157698e3..f8b583ea 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -1051,6 +1051,9 @@ static int mixer_callback(snd_mixer_elem_t *elem, unsigned int mask) {
if (mask == SND_CTL_EVENT_MASK_REMOVE)
return 0;
+ if (u->source->suspend_cause & PA_SUSPEND_SESSION)
+ return 0;
+
if (mask & SND_CTL_EVENT_MASK_VALUE) {
pa_source_get_volume(u->source, TRUE);
pa_source_get_mute(u->source, TRUE);