acp: add options to disable profile and port switching

See #498
This commit is contained in:
Wim Taymans 2020-12-22 13:08:14 +01:00
parent 09265e116e
commit a8937413e6
2 changed files with 17 additions and 2 deletions

View file

@ -910,6 +910,10 @@ impl_init(const struct spa_handle_factory *factory,
if (info) {
if ((str = spa_dict_lookup(info, SPA_KEY_API_ALSA_PATH)) != NULL)
snprintf(this->props.device, sizeof(this->props.device)-1, "%s", str);
if ((str = spa_dict_lookup(info, "api.acp.auto-port")) != NULL)
this->props.auto_port = strcmp(str, "true") == 0 || atoi(str) != 0;
if ((str = spa_dict_lookup(info, "api.acp.auto-profile")) != NULL)
this->props.auto_profile = strcmp(str, "true") == 0 || atoi(str) != 0;
items = alloca((info->n_items) * sizeof(*items));
spa_dict_for_each(it, info)