From 153a607801b677d21d7ad4a417fb8d8217512269 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 29 Jul 2013 17:04:37 +0300 Subject: [PATCH] audio/AVRCP: Connect browsing channel in case of GetCapabilities response If the remote stack respond to GetCapabilities before connecting to browsing channel connect it immediatelly as some events might depend on it to work properly. The spec actually recommends the browsing channel to be connected immediatelly after the control channel: AVRCP 1.5 - Page 23 "4.1.1 Connection establishment ... If a browsing channel is supported by both devices it shall be established after control channel establishment. It is recommended that the browsing channel is established immediately after the control channel is established and released immediately before the control channel is released to avoid unsatisfactory latency when a browsing command is sent." --- profiles/audio/avrcp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c index 8c39d968b..9f164e41e 100644 --- a/profiles/audio/avrcp.c +++ b/profiles/audio/avrcp.c @@ -3195,6 +3195,13 @@ static gboolean avrcp_get_capabilities_resp(struct avctp *conn, if (pdu == NULL || pdu->params[0] != CAP_EVENTS_SUPPORTED) return FALSE; + /* Connect browsing if pending */ + if (session->browsing_timer > 0) { + g_source_remove(session->browsing_timer); + session->browsing_timer = 0; + avctp_connect_browsing(session->conn); + } + count = pdu->params[1]; for (; count > 0; count--) { -- 2.11.0