diff options
author | Lukasz Rymanowski <lukasz.rymanowski@tieto.com> | 2014-08-08 15:42:33 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2014-08-08 17:28:39 +0300 |
commit | 6e01436e9b09b038c358b0695548a7a2c3059bdb (patch) | |
tree | 12479278ad76051d5f36094ececb16cfeba099a9 /android/avdtp.c | |
parent | 4b9b09235ead46029da25f12a20fa6b993bb924f (diff) | |
download | bluez-6e01436e9b09b038c358b0695548a7a2c3059bdb.tar.gz |
android/a2dp: Improve avdtp_close function
With this patch avdtp_close does avdtp_abort under the hood in case
stream is not yet in OPEN state.
Diffstat (limited to 'android/avdtp.c')
-rw-r--r-- | android/avdtp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/android/avdtp.c b/android/avdtp.c index 89f486024..85ef94b3a 100644 --- a/android/avdtp.c +++ b/android/avdtp.c @@ -3244,14 +3244,15 @@ int avdtp_close(struct avdtp *session, struct avdtp_stream *stream, if (!g_slist_find(session->streams, stream)) return -EINVAL; - if (stream->lsep->state < AVDTP_STATE_OPEN) - return -EINVAL; - if (stream->close_int == TRUE) { error("avdtp_close: rejecting since close is already initiated"); return -EINVAL; } + /* If stream is not yet in the OPEN state, let's use ABORT_CMD */ + if (stream->lsep->state < AVDTP_STATE_OPEN) + return avdtp_abort(session, stream); + if (immediate && session->req && stream == session->req->stream) return avdtp_abort(session, stream); |