mirror of
https://gitlab.gnome.org/GNOME/libgnome-volume-control.git
synced 2024-11-23 01:10:40 -05:00
mixer-card: Return in set_profile() when profile is already set
When we change the card profile, there's two paths the current profile gets updated after the change: From _pa_context_set_card_profile_by_index_cb() and from update_card() in gvc-mixer-control.c. Both call gvc_mixer_card_set_profile(), and if the profile change was initiated by us, we might call set_profile() twice. Handle this a bit better in set_profile() and early-return in case the current profile is already set.
This commit is contained in:
parent
cc46b231cf
commit
f75ad37943
@ -179,6 +179,9 @@ gvc_mixer_card_set_profile (GvcMixerCard *card,
|
||||
g_return_val_if_fail (GVC_IS_MIXER_CARD (card), FALSE);
|
||||
g_return_val_if_fail (card->priv->profiles != NULL, FALSE);
|
||||
|
||||
if (g_strcmp0 (card->priv->profile, profile) == 0)
|
||||
return TRUE;
|
||||
|
||||
g_free (card->priv->profile);
|
||||
card->priv->profile = g_strdup (profile);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user