mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-10 00:25:43 +01:00
topology: pre-process-object: dont create if section already exists
Skip creating section when it exists already. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
3c81766242
commit
c1f0ec46b4
1 changed files with 9 additions and 7 deletions
|
@ -880,16 +880,18 @@ int tplg_build_object_from_template(struct tplg_pre_processor *tplg_pp, snd_conf
|
|||
*wtop = top;
|
||||
} else {
|
||||
*wtop = tplg_find_config(top, object_name);
|
||||
if (!(*wtop)) {
|
||||
ret = tplg_config_make_add(wtop, object_name, SND_CONFIG_TYPE_COMPOUND,
|
||||
top);
|
||||
if (ret < 0) {
|
||||
SNDERR("Error creating config for %s\n", object_name);
|
||||
return ret;
|
||||
}
|
||||
if (*wtop)
|
||||
goto template;
|
||||
|
||||
ret = tplg_config_make_add(wtop, object_name, SND_CONFIG_TYPE_COMPOUND,
|
||||
top);
|
||||
if (ret < 0) {
|
||||
SNDERR("Error creating config for %s\n", object_name);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
template:
|
||||
/* create template config */
|
||||
if (!map->template_items)
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue