[pulseaudio-discuss] [PATCH] dbus: fix card profile change signals
Georg Chini
georg at chini.tk
Thu Mar 9 20:02:47 UTC 2017
On 18.02.2017 17:40, Tanu Kaskinen wrote:
> The "profile->card != c->card" check always evaluated to false, so the
> CardProfileUpdated signal was never sent. The reason: call_data was
> assigned to a pa_card_profile pointer, but the correct type is a pa_card
> pointer.
> ---
> src/modules/dbus/iface-card.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/src/modules/dbus/iface-card.c b/src/modules/dbus/iface-card.c
> index 1b705ba7b..520325065 100644
> --- a/src/modules/dbus/iface-card.c
> +++ b/src/modules/dbus/iface-card.c
> @@ -457,27 +457,27 @@ static void check_card_proplist(pa_dbusiface_card *c) {
> }
>
> static pa_hook_result_t card_profile_changed_cb(void *hook_data, void *call_data, void *slot_data) {
> - pa_dbusiface_card *c = slot_data;
> - pa_card_profile *profile = call_data;
> + pa_dbusiface_card *dbus_card = slot_data;
> + pa_card *core_card = call_data;
> const char *object_path;
> DBusMessage *signal_msg;
>
> - if (profile->card != c->card)
> + if (dbus_card->card != core_card)
> return PA_HOOK_OK;
>
> - c->active_profile = c->card->active_profile;
> + dbus_card->active_profile = dbus_card->card->active_profile;
>
> - object_path = pa_dbusiface_card_profile_get_path(pa_hashmap_get(c->profiles, c->active_profile->name));
> + object_path = pa_dbusiface_card_profile_get_path(pa_hashmap_get(dbus_card->profiles, dbus_card->active_profile->name));
>
> - pa_assert_se(signal_msg = dbus_message_new_signal(c->path,
> + pa_assert_se(signal_msg = dbus_message_new_signal(dbus_card->path,
> PA_DBUSIFACE_CARD_INTERFACE,
> signals[SIGNAL_ACTIVE_PROFILE_UPDATED].name));
> pa_assert_se(dbus_message_append_args(signal_msg, DBUS_TYPE_OBJECT_PATH, &object_path, DBUS_TYPE_INVALID));
>
> - pa_dbus_protocol_send_signal(c->dbus_protocol, signal_msg);
> + pa_dbus_protocol_send_signal(dbus_card->dbus_protocol, signal_msg);
> dbus_message_unref(signal_msg);
>
> - check_card_proplist(c);
> + check_card_proplist(dbus_card);
>
> return PA_HOOK_OK;
> }
Looks good to me.
More information about the pulseaudio-discuss
mailing list