| 1 |
From 10a0c18b8e3058144586880019b68ab4ea40ce78 Mon Sep 17 00:00:00 2001 |
| 2 |
From: David Henningsson <david.henningsson@canonical.com> |
| 3 |
Date: Fri, 7 Dec 2012 16:22:09 +0530 |
| 4 |
Subject: [PATCH] sound: Fix port handling for the unknown availability case |
| 5 |
|
| 6 |
The current code assumes that port availability transitions will be |
| 7 |
between YES and NO, and doesn't account for the fact that it may also be |
| 8 |
UNKNOWN. This causes spurious entries if the port availability |
| 9 |
transitions between YES and UNKNOWN. |
| 10 |
--- |
| 11 |
panels/sound/gvc-mixer-control.c | 2 +- |
| 12 |
1 file changed, 1 insertion(+), 1 deletion(-) |
| 13 |
|
| 14 |
diff --git a/panels/sound/gvc-mixer-control.c b/panels/sound/gvc-mixer-control.c |
| 15 |
index 34ddc0c..2f6cf34 100644 |
| 16 |
--- a/panels/sound/gvc-mixer-control.c |
| 17 |
+++ b/panels/sound/gvc-mixer-control.c |
| 18 |
@@ -2138,7 +2138,7 @@ update_card (GvcMixerControl *control, |
| 19 |
else { |
| 20 |
for (i = 0; i < info->n_ports; i++) { |
| 21 |
if (g_strcmp0 (card_port->port, info->ports[i]->name) == 0) { |
| 22 |
- if (card_port->available != info->ports[i]->available) { |
| 23 |
+ if ((card_port->available == PA_PORT_AVAILABLE_NO) != (info->ports[i]->available == PA_PORT_AVAILABLE_NO)) { |
| 24 |
card_port->available = info->ports[i]->available; |
| 25 |
g_debug ("sync port availability on card %i, card port name '%s', new available value %i", |
| 26 |
gvc_mixer_card_get_index (card), |
| 27 |
-- |
| 28 |
1.8.0 |