mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-10 04:05:43 +01:00
topology: use cached Define subtree in pre_process_includes()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
123eecf7fa
commit
7245f63b2e
1 changed files with 5 additions and 6 deletions
|
@ -419,20 +419,19 @@ err:
|
||||||
static int pre_process_includes(struct tplg_pre_processor *tplg_pp, snd_config_t *top)
|
static int pre_process_includes(struct tplg_pre_processor *tplg_pp, snd_config_t *top)
|
||||||
{
|
{
|
||||||
snd_config_iterator_t i, next;
|
snd_config_iterator_t i, next;
|
||||||
snd_config_t *includes, *conf_defines;
|
snd_config_t *includes;
|
||||||
const char *top_id;
|
const char *top_id;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
if (tplg_pp->define_cfg_merged == NULL)
|
||||||
|
return 0;
|
||||||
|
|
||||||
ret = snd_config_search(top, "IncludeByKey", &includes);
|
ret = snd_config_search(top, "IncludeByKey", &includes);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
snd_config_get_id(top, &top_id);
|
snd_config_get_id(top, &top_id);
|
||||||
|
|
||||||
ret = snd_config_search(tplg_pp->input_cfg, "Define", &conf_defines);
|
|
||||||
if (ret < 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
snd_config_for_each(i, next, includes) {
|
snd_config_for_each(i, next, includes) {
|
||||||
snd_config_t *n, *new, *define;
|
snd_config_t *n, *new, *define;
|
||||||
const char *id;
|
const char *id;
|
||||||
|
@ -442,7 +441,7 @@ static int pre_process_includes(struct tplg_pre_processor *tplg_pp, snd_config_t
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* find id from variable definitions */
|
/* find id from variable definitions */
|
||||||
ret = snd_config_search(conf_defines, id, &define);
|
ret = snd_config_search(tplg_pp->define_cfg_merged, id, &define);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
fprintf(stderr, "No variable defined for %s\n", id);
|
fprintf(stderr, "No variable defined for %s\n", id);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in a new issue