From dc5b85fe577491fabb9a2d0d22c019d947e2822e Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Thu, 17 Oct 2024 11:37:54 +0300 Subject: [PATCH] bluez5: backend-native: fallthrough to report volume instead of duplicating code --- spa/plugins/bluez5/backend-native.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spa/plugins/bluez5/backend-native.c b/spa/plugins/bluez5/backend-native.c index 920dd3cf2..24794cf82 100644 --- a/spa/plugins/bluez5/backend-native.c +++ b/spa/plugins/bluez5/backend-native.c @@ -2114,6 +2114,7 @@ static bool rfcomm_hfp_hf(struct rfcomm *rfcomm, char* token) case hfp_hf_ccwa: rfcomm->hf_state = hfp_hf_slc1; rfcomm->slc_configured = true; + if (!rfcomm->codec_negotiation_supported) { if (rfcomm_new_transport(rfcomm) < 0) { // TODO: We should manage the missing transport @@ -2122,15 +2123,14 @@ static bool rfcomm_hfp_hf(struct rfcomm *rfcomm, char* token) spa_bt_device_connect_profile(rfcomm->device, rfcomm->profile); } } - /* Report volume on SLC establishment */ - if (rfcomm_send_volume_cmd(rfcomm, SPA_BT_VOLUME_ID_RX)) - rfcomm->hf_state = hfp_hf_vgs; rfcomm->telephony_ag = telephony_ag_new(backend->telephony, sizeof(struct spa_hook)); telephony_ag_add_listener(rfcomm->telephony_ag, telephony_ag_get_user_data(rfcomm->telephony_ag), &telephony_ag_events, rfcomm); telephony_ag_register(rfcomm->telephony_ag); - break; + + /* Report volume on SLC establishment */ + SPA_FALLTHROUGH; case hfp_hf_slc2: if (rfcomm_send_volume_cmd(rfcomm, SPA_BT_VOLUME_ID_RX)) rfcomm->hf_state = hfp_hf_vgs;