Fix for avdtp audio disconnexts

This commit is contained in:
Peter Robinson 2021-03-14 19:04:04 +00:00
parent e5a6d99cfa
commit 47bb2ac98f
2 changed files with 46 additions and 1 deletions

View File

@ -0,0 +1,41 @@
From 28ddec8d6b829e002fa268c07b71e4c564ba9e16 Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: Thu, 11 Mar 2021 07:36:07 -0800
Subject: [PATCH] avdtp: Fix removing all remote SEPs when loading from cache
If avdtp_discover is called after cache has been loaded it end up
removing all remote SEPs as they have not been discovered yet.
Fixes: https://github.com/bluez/bluez/issues/102
---
profiles/audio/avdtp.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c
index 088ca58b3..1d5871c62 100644
--- a/profiles/audio/avdtp.c
+++ b/profiles/audio/avdtp.c
@@ -3381,10 +3381,18 @@ int avdtp_discover(struct avdtp *session, avdtp_discover_cb_t cb,
session->discover = g_new0(struct discover_callback, 1);
if (session->seps) {
- session->discover->cb = cb;
- session->discover->user_data = user_data;
- session->discover->id = g_idle_add(process_discover, session);
- return 0;
+ struct avdtp_remote_sep *sep = session->seps->data;
+
+ /* Check that SEP have been discovered as it may be loaded from
+ * cache.
+ */
+ if (sep->discovered) {
+ session->discover->cb = cb;
+ session->discover->user_data = user_data;
+ session->discover->id = g_idle_add(process_discover,
+ session);
+ return 0;
+ }
}
err = send_request(session, FALSE, NULL, AVDTP_DISCOVER, NULL, 0);

View File

@ -6,7 +6,7 @@
Name: bluez
Version: 5.56
Release: 3%{?dist}
Release: 4%{?dist}
Summary: Bluetooth utilities
License: GPLv2+
URL: http://www.bluez.org/
@ -22,6 +22,7 @@ Patch11: 0002-systemd-Add-PrivateTmp-and-NoNewPrivileges-options.patch
Patch12: 0003-systemd-Add-more-filesystem-lockdown.patch
Patch13: 0004-systemd-More-lockdown.patch
Patch14: 0005-media-rename-local-function-conflicting-with-pause-2.patch
Patch15: bluez-avdtp-fix-removing-all-seps-when-loading-from-cache.patch
BuildRequires: dbus-devel >= 1.6
BuildRequires: glib2-devel
@ -314,6 +315,9 @@ install emulator/btvirt ${RPM_BUILD_ROOT}/%{_libexecdir}/bluetooth/
%{_userunitdir}/obex.service
%changelog
* Sun Mar 14 2021 Peter Robinson <pbrobinson@fedoraproject.org> - 5.56-4
- Fix for avdtp audio disconnexts
* Sun Mar 14 2021 Hans de Goede <hdegoede@redhat.com> - 5.56-3
- Drop obsolete udev rule + systemd service to call btattach on BT-HCIs
connected via UART from userspace, this is all handled in the kernel now