From aa005c05b6c7fb4b8164c5009740270acb714a6b Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 18 Mar 2013 10:14:40 -0300 Subject: [PATCH] AVRCP: Fallback to GetElementAttributes if GetItemAttributes fails If GetItemAttributes fails with error set to player not browsable fallback to GetElementAttributes. --- profiles/audio/avrcp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c index 5b5f4910d..409cf5b9d 100644 --- a/profiles/audio/avrcp.c +++ b/profiles/audio/avrcp.c @@ -74,6 +74,7 @@ #define AVRCP_STATUS_INTERNAL_ERROR 0x03 #define AVRCP_STATUS_SUCCESS 0x04 #define AVRCP_STATUS_INVALID_PLAYER_ID 0x11 +#define AVRCP_STATUS_PLAYER_NOT_BROWSABLE 0x12 #define AVRCP_STATUS_NO_AVAILABLE_PLAYERS 0x15 #define AVRCP_STATUS_ADDRESSED_PLAYER_CHANGED 0x16 @@ -2002,8 +2003,11 @@ static gboolean avrcp_get_item_attributes_rsp(struct avctp *conn, struct avrcp_browsing_header *pdu = (void *) operands; uint8_t count; - if (pdu->params[0] != AVRCP_STATUS_SUCCESS || operand_count < 4) + if (pdu->params[0] != AVRCP_STATUS_SUCCESS || operand_count < 4) { + if (pdu->params[0] == AVRCP_STATUS_PLAYER_NOT_BROWSABLE) + avrcp_get_element_attributes(session); return FALSE; + } count = pdu->params[1]; -- 2.47.3