[PATCH BlueZ 1/2] sink: clean up outstanding AVDTP requests if the stream goes away.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If the stream goes IDLE while we have an outstanding request, connect_id
stays non-zero and is never cleared via a completion callback. As a
consequence, the profile on this device will never be connected
successfully again until BlueZ restarts.
---
 profiles/audio/sink.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/profiles/audio/sink.c b/profiles/audio/sink.c
index a547dcb41..77f195436 100644
--- a/profiles/audio/sink.c
+++ b/profiles/audio/sink.c
@@ -137,6 +137,11 @@ static void stream_state_changed(struct avdtp_stream *stream,
 	case AVDTP_STATE_IDLE:
 		btd_service_disconnecting_complete(sink->service, 0);
 
+		if (sink->connect_id > 0) {
+			a2dp_cancel(sink->connect_id);
+			sink->connect_id = 0;
+		}
+
 		if (sink->disconnect_id > 0) {
 			a2dp_cancel(sink->disconnect_id);
 			sink->disconnect_id = 0;
-- 
2.43.0





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux