summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2020-08-03 18:15:04 +0200
committerWim Taymans <wtaymans@redhat.com>2020-08-03 18:15:04 +0200
commit9943733b8c98fa859d427dadf50ba327af2416d5 (patch)
tree8371d88deeeef7da7567d80786a3b6d8e9af611b
parentd76b509995df5277ad82185e2307610ca954a699 (diff)
acp: pass all properties when creating a card
They might contain other info like prefered card name etc.
-rw-r--r--spa/plugins/alsa/alsa-acp-device.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/spa/plugins/alsa/alsa-acp-device.c b/spa/plugins/alsa/alsa-acp-device.c
index 12812e54..7a969ccf 100644
--- a/spa/plugins/alsa/alsa-acp-device.c
+++ b/spa/plugins/alsa/alsa-acp-device.c
@@ -802,7 +802,8 @@ impl_init(const struct spa_handle_factory *factory,
{
struct impl *this;
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;
spa_return_val_if_fail(factory != NULL, -EINVAL);
@@ -834,10 +835,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, SPA_KEY_DEVICE_PROFILE_SET)) != NULL)
- items[n_items++] = ACP_DICT_ITEM_INIT("profile-set", str);
- if ((str = spa_dict_lookup(info, SPA_KEY_DEVICE_PROFILE)) != NULL)
- items[n_items++] = ACP_DICT_ITEM_INIT("profile", str);
+
+ items = alloca((info->n_items) * sizeof(*items));
+ spa_dict_for_each(it, info)
+ items[n_items++] = ACP_DICT_ITEM_INIT(it->key, it->value);
}
spa_log_debug(this->log, "probe card %s", this->props.device);