aboutsummaryrefslogtreecommitdiff
path: root/audio/avdtp.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2009-02-04 09:39:57 -0800
committerJohan Hedberg <johan.hedberg@nokia.com>2009-02-04 09:39:57 -0800
commit8569aed5570e415a2d4361c521c0b511684e3b7e (patch)
tree878d2839e2c280dc4e4fd06a1f108ca43514c3f8 /audio/avdtp.c
parent584fe1b71eca9a98b5a0a75e08aaa4fafc4e8d83 (diff)
downloadbluez-8569aed5570e415a2d4361c521c0b511684e3b7e.tar.gz
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.
Diffstat (limited to 'audio/avdtp.c')
-rw-r--r--audio/avdtp.c8
1 files changed, 5 insertions, 3 deletions
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);