]> code.delx.au - pulseaudio/commitdiff
alsa: ignore volume changes from the hw if we are not on the active console
authorLennart Poettering <lennart@poettering.net>
Wed, 13 Jan 2010 19:30:36 +0000 (20:30 +0100)
committerColin Guthrie <cguthrie@mandriva.org>
Tue, 9 Feb 2010 22:32:28 +0000 (22:32 +0000)
src/modules/alsa/alsa-sink.c
src/modules/alsa/alsa-source.c

index ed16c8348e4e281ffdb6ce92856e4761c4e97df9..690480f79e5b1fd051f219b835aa489725ad564b 100644 (file)
@@ -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);
index 157698e3d007d52650d6f4d2dc8caa708a2b7e95..f8b583eadcadcf10338a032c20a88c9e38910428 100644 (file)
@@ -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);