From 95f8efcebacc3cc86f96d447f366100f9c8abd9e Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Sun, 19 Oct 2008 21:51:07 +0300 Subject: Check for existing STREAMING state when receiving START_RSP This could happen if both peers send START_CMD at the same time and the SNK peer doesn't reject the command (as it should according to the spec). This behaviour can be seen e.g. when using pulseaudio and the Mororola S9 headset. --- audio/avdtp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/audio/avdtp.c b/audio/avdtp.c index 361c5eee..87e19cca 100644 --- a/audio/avdtp.c +++ b/audio/avdtp.c @@ -1922,7 +1922,10 @@ static gboolean avdtp_start_resp(struct avdtp *session, if (sep->cfm && sep->cfm->start) sep->cfm->start(session, sep, stream, NULL, sep->user_data); - avdtp_sep_set_state(session, sep, AVDTP_STATE_STREAMING); + /* We might be in STREAMING already if both sides send START_CMD at the + * same time and the one in SNK role doesn't reject it as it should */ + if (sep->state != AVDTP_STATE_STREAMING) + avdtp_sep_set_state(session, sep, AVDTP_STATE_STREAMING); return TRUE; } -- cgit