summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-10-19 21:51:07 +0300
committerJohan Hedberg <johan.hedberg@nokia.com>2008-10-19 21:51:07 +0300
commit95f8efcebacc3cc86f96d447f366100f9c8abd9e (patch)
treea77d8c9943b26015d4f820ec36c948497b4a3ed6
parenta1ac214c97e81fefc4393fdfea0e5c9041f75bdd (diff)
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.
-rw-r--r--audio/avdtp.c5
1 files changed, 4 insertions, 1 deletions
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;
}