From 27efc30f049972595f517a4072159df7c9bceee9 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 23 Jul 2013 15:52:30 +0300 Subject: [PATCH] audio/AVRCP: Fix registration of VOLUME_CHANGED First check with GetCapabilities if the event is really support before registering. --- profiles/audio/avrcp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c index ad7742d2a..9baf0d3d0 100644 --- a/profiles/audio/avrcp.c +++ b/profiles/audio/avrcp.c @@ -3205,6 +3205,7 @@ static gboolean avrcp_get_capabilities_resp(struct avctp *conn, case AVRCP_EVENT_ADDRESSED_PLAYER_CHANGED: case AVRCP_EVENT_UIDS_CHANGED: case AVRCP_EVENT_AVAILABLE_PLAYERS_CHANGED: + case AVRCP_EVENT_VOLUME_CHANGED: avrcp_register_notification(session, event); break; } @@ -3336,7 +3337,9 @@ static void target_init(struct avrcp *session) if (target->version < 0x0104) return; - avrcp_register_notification(session, AVRCP_EVENT_VOLUME_CHANGED); + /* Only check capabilities if controller is not supported */ + if (session->controller == NULL) + avrcp_get_capabilities(session); /* Auto-connect browsing channel only if initiator */ if (old_state == BTD_SERVICE_STATE_CONNECTING && -- 2.47.3