gvc-mixer-control: Fix bluetooth duplicates

Entries are only hidden when available == PA_PORT_AVAILABLE_NO, so if an
entry toggles between PA_PORT_AVAILABLE_YES and
PA_PORT_AVAILABLE_UNKNOWN (Bluetooth headset switching between HSP/HFP
and A2DP for example), this should not result in new entries being created.

https://bugzilla.gnome.org/show_bug.cgi?id=697545
This commit is contained in:
David Henningsson 2014-09-18 11:44:34 +02:00 committed by Bastien Nocera
parent e14dbe8aa6
commit fac3a900e5

View File

@ -2136,7 +2136,7 @@ update_card (GvcMixerControl *control,
else { else {
for (i = 0; i < info->n_ports; i++) { for (i = 0; i < info->n_ports; i++) {
if (g_strcmp0 (card_port->port, info->ports[i]->name) == 0) { if (g_strcmp0 (card_port->port, info->ports[i]->name) == 0) {
if (card_port->available != info->ports[i]->available) { if ((card_port->available == PA_PORT_AVAILABLE_NO) != (info->ports[i]->available == PA_PORT_AVAILABLE_NO)) {
card_port->available = info->ports[i]->available; card_port->available = info->ports[i]->available;
g_debug ("sync port availability on card %i, card port name '%s', new available value %i", g_debug ("sync port availability on card %i, card port name '%s', new available value %i",
gvc_mixer_card_get_index (card), gvc_mixer_card_get_index (card),