diff mbox series

[v3,2/2] avrcp: Don't attempt to load settings if on volume changed is supported

Message ID 20200528215300.225894-2-luiz.dentz@gmail.com (mailing list archive)
State Accepted
Delegated to: Luiz Von Dentz
Headers show
Series [v3,1/2] avrcp: Fix always requesting player settings for category 1 | expand

Commit Message

Luiz Augusto von Dentz May 28, 2020, 9:53 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

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(+)

Comments

Andrey Semashev May 28, 2020, 11:10 p.m. UTC | #1
On 2020-05-29 00:53, Luiz Augusto von Dentz wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> 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(+)
> 
> diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
> index 75811bf98..8b3debe46 100644
> --- a/profiles/audio/avrcp.c
> +++ b/profiles/audio/avrcp.c
> @@ -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 == (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);
> 

This patchset works, MTW2 is able to connect and play audio. Many thanks!
diff mbox series

Patch

diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index 75811bf98..8b3debe46 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -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 == (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);