From 689e2d0cc9dc215839f50e64565623cd931e410b Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Mon, 25 Apr 2022 21:20:10 +0300 Subject: [PATCH] bluez5: clear codec switch flag on device connnection change Codec switch flag should be cleared on device connection status change, to deal with codec_switched() callback not being called if device is suddenly disconnected. --- spa/plugins/bluez5/bluez5-device.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spa/plugins/bluez5/bluez5-device.c b/spa/plugins/bluez5/bluez5-device.c index 0526db5c6..6c45a028b 100644 --- a/spa/plugins/bluez5/bluez5-device.c +++ b/spa/plugins/bluez5/bluez5-device.c @@ -1098,6 +1098,8 @@ static void set_initial_profile(struct impl *this) struct spa_bt_transport *t; int i; + this->switching_codec = false; + if (this->supported_codecs) free(this->supported_codecs); this->supported_codecs = spa_bt_device_get_supported_a2dp_codecs(