summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPauli Virtanen <pav@iki.fi>2022-01-12 20:07:44 +0200
committerPauli Virtanen <pav@iki.fi>2022-01-12 20:47:25 +0200
commit8e7a5a4c3e51007ce6579292642517e3d3eb9c50 (patch)
tree4ce42842e7d1ed6269b7ea887542893f1f7dc208
parentc5ab6037f460406ac9799b1e5765de3ce0097a8b (diff)
downloadlibgnome-volume-control-master.tar.gz
mixer-control: fix gvc_mixer_card_set_profiles API usageHEADmaster
In update_card, profile_list is incorrectly used also after its ownership is transferred to the GvcMixerCard. In practice, this causes e.g. some profiles to go missing due to the list head being clobbered. Fix this by calling gvc_mixer_card_set_profiles only after profiles_list is no longer used for any other purpose.
-rw-r--r--gvc-mixer-control.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gvc-mixer-control.c b/gvc-mixer-control.c
index 45c729c..6218a1b 100644
--- a/gvc-mixer-control.c
+++ b/gvc-mixer-control.c
@@ -2590,7 +2590,6 @@ update_card (GvcMixerControl *control,
}
card = gvc_mixer_card_new (control->priv->pa_context,
info->index);
- gvc_mixer_card_set_profiles (card, profile_list);
for (i = 0; i < info->n_ports; i++) {
GvcMixerCardPort *port;
@@ -2604,6 +2603,8 @@ update_card (GvcMixerControl *control,
port->profiles = determine_profiles_for_port (info->ports[i], profile_list);
port_list = g_list_prepend (port_list, port);
}
+
+ gvc_mixer_card_set_profiles (card, profile_list);
gvc_mixer_card_set_ports (card, port_list);
is_new = TRUE;
}