protocol-native: log who changes card profiles

Some volume control applications, including gnome-control-center[1],
Budgie Volume Control[2] and possibly something in xfce4 too[3],
sometimes do unwanted card profile changes. This patch makes it possible
to see from the log which application requested a profile change, which
makes it easier to detect when an application misbehaves.

[1] https://bugzilla.gnome.org/show_bug.cgi?id=762932
[2] https://bugs.freedesktop.org/show_bug.cgi?id=93903#c41
[3] https://bugs.freedesktop.org/show_bug.cgi?id=93903#c40
This commit is contained in:
Tanu Kaskinen 2017-04-04 12:46:25 +03:00
parent b6777d7f09
commit 2432270a73

View file

@ -4721,6 +4721,11 @@ static void command_set_card_profile(pa_pdispatch *pd, uint32_t command, uint32_
CHECK_VALIDITY(c->pstream, profile, tag, PA_ERR_NOENTITY); CHECK_VALIDITY(c->pstream, profile, tag, PA_ERR_NOENTITY);
pa_log_info("Application \"%s\" requests card profile change. card = %s, profile = %s",
pa_strnull(pa_proplist_gets(c->client->proplist, PA_PROP_APPLICATION_NAME)),
card->name,
profile->name);
if ((ret = pa_card_set_profile(card, profile, true)) < 0) { if ((ret = pa_card_set_profile(card, profile, true)) < 0) {
pa_pstream_send_error(c->pstream, tag, -ret); pa_pstream_send_error(c->pstream, tag, -ret);
return; return;