acp: pass all properties when creating a card

They might contain other info like prefered card name etc.
This commit is contained in:
Wim Taymans 2020-08-03 18:15:04 +02:00
parent d76b509995
commit 9943733b8c

View file

@ -802,7 +802,8 @@ impl_init(const struct spa_handle_factory *factory,
{ {
struct impl *this; struct impl *this;
const char *str; const char *str;
struct acp_dict_item items[4]; struct acp_dict_item *items = NULL;
const struct spa_dict_item *it;
uint32_t n_items = 0; uint32_t n_items = 0;
spa_return_val_if_fail(factory != NULL, -EINVAL); spa_return_val_if_fail(factory != NULL, -EINVAL);
@ -834,10 +835,10 @@ impl_init(const struct spa_handle_factory *factory,
if (info) { if (info) {
if ((str = spa_dict_lookup(info, SPA_KEY_API_ALSA_PATH)) != NULL) if ((str = spa_dict_lookup(info, SPA_KEY_API_ALSA_PATH)) != NULL)
snprintf(this->props.device, sizeof(this->props.device)-1, "%s", str); snprintf(this->props.device, sizeof(this->props.device)-1, "%s", str);
if ((str = spa_dict_lookup(info, SPA_KEY_DEVICE_PROFILE_SET)) != NULL)
items[n_items++] = ACP_DICT_ITEM_INIT("profile-set", str); items = alloca((info->n_items) * sizeof(*items));
if ((str = spa_dict_lookup(info, SPA_KEY_DEVICE_PROFILE)) != NULL) spa_dict_for_each(it, info)
items[n_items++] = ACP_DICT_ITEM_INIT("profile", str); items[n_items++] = ACP_DICT_ITEM_INIT(it->key, it->value);
} }
spa_log_debug(this->log, "probe card %s", this->props.device); spa_log_debug(this->log, "probe card %s", this->props.device);