bluez5: simplify SCO datapath parsing with spa_atou32

This commit is contained in:
Mengshi Wu 2026-01-19 15:04:46 +08:00 committed by Wim Taymans
parent 2d6a7d2186
commit 2b5d21da5b

View File

@ -4136,14 +4136,10 @@ static void parse_hfp_default_volumes(struct impl *backend, const struct spa_dic
static void parse_sco_datapath(struct impl *backend, const struct spa_dict *info)
{
uint32_t tmp;
const char *str;
backend->hfphsp_sco_datapath = HFP_SCO_DEFAULT_DATAPATH;
if ((str = spa_dict_lookup(info, "bluez5.hw-offload-datapath")) != NULL &&
(tmp = atoi(str)) > 0)
backend->hfphsp_sco_datapath = tmp;
spa_atou32(spa_dict_lookup(info, "bluez5.hw-offload-datapath"),
&backend->hfphsp_sco_datapath, 10);
}
static const struct spa_bt_backend_implementation backend_impl = {