alsa-ucm: Make mapping UCM contexts have only one device

After previous patches, we should be generating no combination ports, so
we don't need to store multiple devices per mapping. Simplify the code
based on this.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
This commit is contained in:
Wim Taymans 2023-03-20 17:24:12 +01:00
parent b02c8ba153
commit 31cde774c5
3 changed files with 39 additions and 72 deletions

View file

@ -449,7 +449,7 @@ static void add_profiles(pa_card *impl)
pa_dynarray_append(&impl->out.devices, dev);
}
if (impl->use_ucm) {
if (m->ucm_context.ucm_devices) {
if (m->ucm_context.ucm_device) {
pa_alsa_ucm_add_port(NULL, &m->ucm_context,
true, impl->ports, ap, NULL);
pa_alsa_ucm_add_ports(&dev->ports, m->proplist, &m->ucm_context,
@ -473,7 +473,7 @@ static void add_profiles(pa_card *impl)
}
if (impl->use_ucm) {
if (m->ucm_context.ucm_devices) {
if (m->ucm_context.ucm_device) {
pa_alsa_ucm_add_port(NULL, &m->ucm_context,
false, impl->ports, ap, NULL);
pa_alsa_ucm_add_ports(&dev->ports, m->proplist, &m->ucm_context,
@ -1437,7 +1437,7 @@ int acp_card_set_profile(struct acp_card *card, uint32_t new_index, uint32_t fla
PA_IDXSET_FOREACH(am, np->output_mappings, idx) {
if (impl->use_ucm) {
/* Update ports priorities */
if (am->ucm_context.ucm_devices) {
if (am->ucm_context.ucm_device) {
pa_alsa_ucm_add_port(am->output.ports, &am->ucm_context,
true, impl->ports, np, NULL);
}
@ -1450,7 +1450,7 @@ int acp_card_set_profile(struct acp_card *card, uint32_t new_index, uint32_t fla
PA_IDXSET_FOREACH(am, np->input_mappings, idx) {
if (impl->use_ucm) {
/* Update ports priorities */
if (am->ucm_context.ucm_devices) {
if (am->ucm_context.ucm_device) {
pa_alsa_ucm_add_port(am->input.ports, &am->ucm_context,
false, impl->ports, np, NULL);
}