summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2012-06-15 17:41:41 +0300
committerJohan Hedberg <johan.hedberg@intel.com>2012-06-15 17:50:58 +0300
commit83630251beb6dbd50dd171a9d9040356bf9bc577 (patch)
tree380206fc6b7bf27fb253d7bc5dfb90530d391b6b
parenta59e82103a2b47c5d8039a0c85394c52d07a4252 (diff)
downloadbluez-83630251beb6dbd50dd171a9d9040356bf9bc577.tar.gz
audio: Fix aborting A2DP setup while AVDTP Start is in progress
Change return of avdtp_start to -EINPROGRESS so the caller can check if the operation is in progress and don't abort because of that.
-rw-r--r--audio/a2dp.c4
-rw-r--r--audio/avdtp.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/audio/a2dp.c b/audio/a2dp.c
index fafff87e7..404be53b3 100644
--- a/audio/a2dp.c
+++ b/audio/a2dp.c
@@ -1038,7 +1038,7 @@ static gboolean suspend_ind(struct avdtp *session, struct avdtp_local_sep *sep,
return TRUE;
start_err = avdtp_start(session, a2dp_sep->stream);
- if (start_err < 0) {
+ if (start_err < 0 && start_err != -EINPROGRESS) {
error("avdtp_start: %s (%d)", strerror(-start_err),
-start_err);
finalize_setup_errno(setup, start_err, finalize_resume);
@@ -1086,7 +1086,7 @@ static void suspend_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
}
start_err = avdtp_start(session, a2dp_sep->stream);
- if (start_err < 0) {
+ if (start_err < 0 && start_err != -EINPROGRESS) {
error("avdtp_start: %s (%d)", strerror(-start_err),
-start_err);
finalize_setup_errno(setup, start_err, finalize_suspend, NULL);
diff --git a/audio/avdtp.c b/audio/avdtp.c
index 3ba236626..eb56c7cdd 100644
--- a/audio/avdtp.c
+++ b/audio/avdtp.c
@@ -3675,7 +3675,7 @@ int avdtp_start(struct avdtp *session, struct avdtp_stream *stream)
if (stream->starting == TRUE) {
DBG("stream already started");
- return -EINVAL;
+ return -EINPROGRESS;
}
memset(&req, 0, sizeof(req));