avrcp: Fix always requesting player settings for category 1
Luiz Augusto von Dentz
maintainerPATCH v2 1/2 avrcp: Fix always requesting player settings for category 1
From: Luiz Augusto von Dentz <[email protected]>
Player Application settings is not mandatory for category 1 so instead of always listing the settings the code now checks if AVRCP_FEATURE_PLAYER_SETTINGS is enabled.
--- profiles/audio/avrcp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
profiles/audio/avrcp.c +2 -1
@@ -3814,7 +3814,8 @@ static gboolean avrcp_get_capabilities_resp(struct avctp *conn, uint8_t code,if (!session->controller || !session->controller->player)return FALSE; -if (!(events & (1 <<AVRCP_EVENT_SETTINGS_CHANGED ))) +if ((session->controller->features &AVRCP_FEATURE_PLAYER_SETTINGS ) && + !(events & (1 <<AVRCP_EVENT_SETTINGS_CHANGED )))avrcp_list_player_attributes (session);if (!(events & (1 <<AVRCP_EVENT_STATUS_CHANGED )))
Signature · 1 line
2.25.3
Luiz Augusto von Dentz
maintainerPATCH v2 2/2 avrcp: Don't attempt to load settings if on volume changed is supported
From: Luiz Augusto von Dentz <[email protected]>
If only volume changed is supported that means the player cannot really indicate track/metadata changes so don't attempt to read them.
--- profiles/audio/avrcp.c | 4 ++++ 1 file changed, 4 insertions(+)
profiles/audio/avrcp.c +4 -0
@@ -3814,6 +3814,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 ==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);
Signature · 1 line
2.25.3
Re: [PATCH v2 2/2] avrcp: Don't attempt to load settings if on volume changed is supported
Quoted 14 lines · Luiz Augusto von Dentz
From: Luiz Augusto von Dentz <[email protected]>
If only volume changed is supported that means the player cannot really indicate track/metadata changes so don't attempt to read them.
--- profiles/audio/avrcp.c | 4 ++++ 1 file changed, 4 insertions(+)profiles/audio/avrcp.c +0
-0
profiles/audio/avrcp.c static gboolean avrcp_get_capabilities_resp(struct avctp *conn, uint8_t code, · line 3823
Quoted 10 lines
profiles/audio/avrcp.c +4
-0@@ -3814,6 +3814,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 ==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);
The result is still the same with this patch - MTW2 reboots after GetPlayStatus.
Luiz Augusto von Dentz
maintainerRe: [PATCH v2 2/2] avrcp: Don't attempt to load settings if on volume changed is supported
Hi Andrey,
Quoted 18 lines · Andrey Semashev
Quoted 16 lines · Luiz Augusto von Dentz
From: Luiz Augusto von Dentz <[email protected]>
If only volume changed is supported that means the player cannot really indicate track/metadata changes so don't attempt to read them.
--- profiles/audio/avrcp.c | 4 ++++ 1 file changed, 4 insertions(+)profiles/audio/avrcp.c +0
-0@@ -3814,6 +3814,10 @@ static gboolean avrcp_get_capabilities_resp(struct avctp *conn, uint8_t code,if (!session->controller || !session->controller->player)return FALSE;
Quoted 11 lines
profiles/audio/avrcp.c static gboolean avrcp_get_capabilities_resp(struct avctp *conn, uint8_t code, · line 3823
Quoted 8 lines
profiles/audio/avrcp.c +4
-0+/* Skip if player status/metadata if only volume changes is supported */ +if (events ==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);The result is still the same with this patch - MTW2 reboots after GetPlayStatus.
Looks like the test was wrong, Ive send a v3 fixing that.
Signature · 1 line
Luiz Augusto von Dentz