summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2012-06-15 17:41:37 +0300
committerJohan Hedberg <johan.hedberg@intel.com>2012-06-15 17:49:42 +0300
commit4503dba4ba28299c83aa320a95e988c74b67eaa8 (patch)
treec027fe6b93130f5eb702f420b3014d2f88687e3c
parentc1b89146424569d1fdeeb3bba6624fe9977fd65e (diff)
downloadbluez-4503dba4ba28299c83aa320a95e988c74b67eaa8.tar.gz
audio: Fix handling of A2DP abort indication
When an abort is received all setup callbacks should return an error.
-rw-r--r--audio/a2dp.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/audio/a2dp.c b/audio/a2dp.c
index 5139f6182..d9dcead5f 100644
--- a/audio/a2dp.c
+++ b/audio/a2dp.c
@@ -1182,6 +1182,7 @@ static gboolean abort_ind(struct avdtp *session, struct avdtp_local_sep *sep,
void *user_data)
{
struct a2dp_sep *a2dp_sep = user_data;
+ struct a2dp_setup *setup;
if (a2dp_sep->type == AVDTP_SEP_TYPE_SINK)
DBG("Sink %p: Abort_Ind", sep);
@@ -1190,6 +1191,14 @@ static gboolean abort_ind(struct avdtp *session, struct avdtp_local_sep *sep,
a2dp_sep->stream = NULL;
+ setup = find_setup_by_session(session);
+ if (!setup)
+ return TRUE;
+
+ finalize_setup_errno(setup, -ECONNRESET, finalize_suspend,
+ finalize_resume,
+ finalize_config);
+
return TRUE;
}