mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
bluez5: stop running codec switch on disconnect
When device is disconnected, running codec switches are not meaningful, and should be stopped. The codec switch callback may also trigger A2DP profile switch, which may reconnect the device. Fix it so this does not happen. See #2334
This commit is contained in:
parent
4bcc93b68e
commit
3be019d7a8
1 changed files with 5 additions and 0 deletions
|
|
@ -1307,6 +1307,11 @@ static void device_set_connected(struct spa_bt_device *device, int connected)
|
|||
if (connected)
|
||||
spa_bt_device_check_profiles(device, false);
|
||||
else {
|
||||
/* Stop codec switch on disconnect */
|
||||
struct spa_bt_a2dp_codec_switch *sw;
|
||||
spa_list_consume(sw, &device->codec_switch_list, device_link)
|
||||
a2dp_codec_switch_free(sw);
|
||||
|
||||
if (device->reconnect_state != BT_DEVICE_RECONNECT_INIT)
|
||||
device_stop_timer(device);
|
||||
device_connected(monitor, device, BT_DEVICE_DISCONNECTED);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue