[pulseaudio-discuss] [PATCH] alsa-mixer: Don't remove paths if jacks state.(un)plugged differ

David Henningsson david.henningsson at canonical.com
Mon Mar 12 03:32:43 PDT 2012


If the jack state differs, they are not the same path, so don't
remove them.

Signed-off-by: David Henningsson <david.henningsson at canonical.com>
---
 src/modules/alsa/alsa-mixer.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c
index 59a9ac9..102ec82 100644
--- a/src/modules/alsa/alsa-mixer.c
+++ b/src/modules/alsa/alsa-mixer.c
@@ -3183,7 +3183,9 @@ static void path_set_condense(pa_alsa_path_set *ps, snd_mixer_t *m) {
                     continue;
 
                 PA_LLIST_FOREACH(jb, p2->jacks) {
-                    if (jb->has_control && !strcmp(jb->alsa_name, ja->alsa_name)) {
+                    if (jb->has_control && !strcmp(jb->alsa_name, ja->alsa_name) &&
+                       (ja->state_plugged == jb->state_plugged) &&
+                       (ja->state_unplugged == jb->state_unplugged)) {
                         exists = TRUE;
                         break;
                     }
-- 
1.7.9.1



More information about the pulseaudio-discuss mailing list