mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
bluez5: ensure nodes are removed on disconnect
Emit any remove node events before resetting initial profile. It indicates to the session manager that nodes if any went away before device disconnected. Usually the profile is removed first which removes the nodes. This depends on ordering of events from bluez, which apparently can be different depending on how remote device disconnects.
This commit is contained in:
parent
8a9e7dc1c7
commit
a49d2d41af
1 changed files with 5 additions and 2 deletions
|
|
@ -1038,13 +1038,16 @@ static void profiles_changed(void *userdata, uint32_t prev_profiles, uint32_t pr
|
|||
|
||||
static void set_initial_profile(struct impl *this);
|
||||
|
||||
static void device_connected(void *userdata, bool connected) {
|
||||
static void device_connected(void *userdata, bool connected)
|
||||
{
|
||||
struct impl *this = userdata;
|
||||
|
||||
spa_log_debug(this->log, "connected: %d", connected);
|
||||
|
||||
if (connected ^ (this->profile != DEVICE_PROFILE_OFF))
|
||||
if (connected ^ (this->profile != DEVICE_PROFILE_OFF)) {
|
||||
emit_remove_nodes(this);
|
||||
set_initial_profile(this);
|
||||
}
|
||||
}
|
||||
|
||||
static const struct spa_bt_device_events bt_dev_events = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue