From 8569aed5570e415a2d4361c521c0b511684e3b7e Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 4 Feb 2009 09:39:57 -0800 Subject: Delay AVRCP connection when remote device connects A2DP The audio profile coexistence whitepaper recommends that the initiator of the A2DP connection also initiates the AVRCP connection. This patch adds a two second delay before we attempt connecting AVRCP after the remote device has connected A2DP to us. --- audio/avdtp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'audio/avdtp.c') diff --git a/audio/avdtp.c b/audio/avdtp.c index a45b7d28..4c95fa49 100644 --- a/audio/avdtp.c +++ b/audio/avdtp.c @@ -891,8 +891,10 @@ static void connection_lost(struct avdtp *session, int err) dev = manager_find_device(&session->dst, AUDIO_CONTROL_INTERFACE, FALSE); - if (dev) + if (dev && dev->control) { + device_remove_control_timer(dev); avrcp_disconnect(dev); + } if (session->state == AVDTP_SESSION_STATE_CONNECTED) { char address[18]; @@ -2984,8 +2986,8 @@ static void auth_cb(DBusError *derr, void *user_data) dev = manager_find_device(&session->dst, AUDIO_CONTROL_INTERFACE, FALSE); - if (dev) - avrcp_connect(dev); + if (dev && dev->control) + device_set_control_timer(dev); g_source_remove(session->io); -- cgit