mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
bluez5: close sco socket if bluetooth daemon disappeared
Fixes pipewire/pipewire#853
This commit is contained in:
parent
e2ac16ccbd
commit
d6be84ddd0
2 changed files with 13 additions and 1 deletions
|
|
@ -1387,7 +1387,7 @@ void backend_native_register_profiles(struct spa_bt_backend *backend)
|
|||
sco_listen(backend);
|
||||
}
|
||||
|
||||
void backend_native_unregister_profiles(struct spa_bt_backend *backend)
|
||||
void sco_close(struct spa_bt_backend *backend)
|
||||
{
|
||||
if (backend->sco.fd >= 0) {
|
||||
if (backend->sco.loop)
|
||||
|
|
@ -1396,6 +1396,11 @@ void backend_native_unregister_profiles(struct spa_bt_backend *backend)
|
|||
close (backend->sco.fd);
|
||||
backend->sco.fd = -1;
|
||||
}
|
||||
}
|
||||
|
||||
void backend_native_unregister_profiles(struct spa_bt_backend *backend)
|
||||
{
|
||||
sco_close(backend);
|
||||
|
||||
#ifdef HAVE_BLUEZ_5_BACKEND_HSP_NATIVE
|
||||
if (backend->enabled_profiles & SPA_BT_PROFILE_HSP_AG)
|
||||
|
|
@ -1416,6 +1421,8 @@ void backend_native_free(struct spa_bt_backend *backend)
|
|||
{
|
||||
struct rfcomm *rfcomm;
|
||||
|
||||
sco_close(backend);
|
||||
|
||||
#ifdef HAVE_BLUEZ_5_BACKEND_HSP_NATIVE
|
||||
dbus_connection_unregister_object_path(backend->conn, PROFILE_HSP_AG);
|
||||
dbus_connection_unregister_object_path(backend->conn, PROFILE_HSP_HS);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue