summaryrefslogtreecommitdiff
path: root/profiles
diff options
context:
space:
mode:
authorHuang-Huang Bao <eh5@sokka.cn>2021-05-20 17:22:00 +0800
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2021-05-21 16:55:06 -0700
commitdf6e6b73286dbb2885c68a6c8c1a8bdd1689c880 (patch)
treedfbd0bf7997aecd81aada1febbe3b06db44a7c66 /profiles
parent9e56bced6e389edc636ab430e57e78a314744033 (diff)
downloadbluez-df6e6b73286dbb2885c68a6c8c1a8bdd1689c880.tar.gz
avrcp: Fix unregister AVRCP player
'notify_addressed_player_changed()' expected to be called with 'player->changed_id' set to a non-zero value. player->changed_id = g_idle_add(notify_addressed_player_changed, player); And 'avrcp_player_event()' relies on 'player->changed_id' to perform Addressed Player Changed notification. However, 'avrcp_unregister_player()' calls 'notify_addressed_player_changed()' without adding it to the main loop and set 'player->changed_id'. To indicate addreddsed player changed for both scenarios, we set 'player->changed_id' to 1 at the head of 'notify_addressed_player_changed()'. Fixes https://github.com/bluez/bluez/issues/142
Diffstat (limited to 'profiles')
-rw-r--r--profiles/audio/avrcp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index 58d30b24d..ccf34b220 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -1794,6 +1794,12 @@ static gboolean notify_addressed_player_changed(gpointer user_data)
};
uint8_t i;
+ /*
+ * Set changed_id to an non-zero value to indicate addreddsed player
+ * changed.
+ */
+ player->changed_id = 1;
+
avrcp_player_event(player, AVRCP_EVENT_ADDRESSED_PLAYER_CHANGED, NULL);
/*