From: Daniel Beer Date: Fri, 25 Oct 2024 20:21:40 +0000 (+1300) Subject: sink: clean up outstanding AVDTP requests if the stream goes away X-Git-Tag: accepted/tizen/unified/20250221.111447~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=951a6b30b0f570e8ceddc1eae628494f33a6a49e;p=platform%2Fupstream%2Fbluez.git sink: clean up outstanding AVDTP requests if the stream goes away 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. Signed-off-by: Anuj Jain --- diff --git a/profiles/audio/sink.c b/profiles/audio/sink.c index e0641d71..95d6bc4f 100755 --- a/profiles/audio/sink.c +++ b/profiles/audio/sink.c @@ -146,6 +146,10 @@ static void stream_state_changed(struct avdtp_stream *stream, #ifndef TIZEN_FEATURE_BLUEZ_MODIFY btd_service_disconnecting_complete(sink->service, 0); #endif + if (sink->connect_id > 0) { + a2dp_cancel(sink->connect_id); + sink->connect_id = 0; + } if (sink->disconnect_id > 0) { a2dp_cancel(sink->disconnect_id);