avrcp: Don't attempt to load settings if on volume changed is supported
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Thu, 28 May 2020 17:18:17 +0000 (10:18 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 12 Apr 2021 09:00:49 +0000 (14:30 +0530)
If only volume changed is supported that means the player cannot really
indicate track/metadata changes so don't attempt to read them.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
profiles/audio/avrcp.c

index 6186187..6782487 100644 (file)
@@ -4295,6 +4295,10 @@ static gboolean avrcp_get_capabilities_resp(struct avctp *conn, uint8_t code,
        if (!session->controller || !session->controller->player)
                return FALSE;
 
+       /* Skip if player status/metadata if only volume changes is supported */
+       if (events == (1 << AVRCP_EVENT_VOLUME_CHANGED))
+               return FALSE;
+
        if ((session->controller->features & AVRCP_FEATURE_PLAYER_SETTINGS) &&
                        !(events & (1 << AVRCP_EVENT_SETTINGS_CHANGED)))
                avrcp_list_player_attributes(session);