mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2025-01-16 00:13:23 +08:00
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.
This commit is contained in:
parent
4b9b09235e
commit
6e01436e9b
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user