summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2023-08-31 14:57:14 -0700
committerAyush Garg <ayush.garg@samsung.com>2024-01-05 19:04:04 +0530
commit272f389fbe6b93d99022e653ef9b6b2c2bbcfa33 (patch)
tree0aa3d9a5c618372c039f9b52281bc3a27df983c0
parent68b52738383c2093e6d8bcf98e8ce54a54802d28 (diff)
downloadbluez-272f389fbe6b93d99022e653ef9b6b2c2bbcfa33.tar.gz
bluez-272f389fbe6b93d99022e653ef9b6b2c2bbcfa33.tar.bz2
bluez-272f389fbe6b93d99022e653ef9b6b2c2bbcfa33.zip
bap: Fix not always calling bap_io_close on disconnect
bap_io_disconnected was getting registered for all links while connecting which prevented bap_io_close to be called when ISO socket is disconnected thus the cig_active flag will remain set preventing the IO to be recreated.
-rw-r--r--profiles/audio/bap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index cc25eff5..b4085789 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
@@ -1926,6 +1926,8 @@ static void bap_connecting(struct bt_bap_stream *stream, bool state, int fd,
if (!ep->io) {
io = g_io_channel_unix_new(fd);
+ ep->io_id = g_io_add_watch(io, G_IO_HUP | G_IO_ERR | G_IO_NVAL,
+ bap_io_disconnected, ep);
ep->io = io;
} else
io = ep->io;