mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-05 13:30:00 -05:00
ucm: include - fix compound_merge for arrays
There is a case where the original array has already new indexes (the merged array is placed before the original nodes). Set the temporary index string identifiers to unique strings. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
eec95e69e5
commit
7036ea07c8
1 changed files with 12 additions and 0 deletions
|
|
@ -149,6 +149,18 @@ static int compound_merge(const char *id,
|
||||||
}
|
}
|
||||||
|
|
||||||
idx = 0;
|
idx = 0;
|
||||||
|
|
||||||
|
/* for array, use a temporary non-clashing identifier */
|
||||||
|
if (array > 0) {
|
||||||
|
snd_config_for_each(i, next, dst) {
|
||||||
|
n = snd_config_iterator_entry(i);
|
||||||
|
snprintf(tmpid, sizeof(tmpid), "_tmp_%d", idx++);
|
||||||
|
err = snd_config_set_id(n, tmpid);
|
||||||
|
if (err < 0)
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
snd_config_for_each(i, next, src) {
|
snd_config_for_each(i, next, src) {
|
||||||
n = snd_config_iterator_entry(i);
|
n = snd_config_iterator_entry(i);
|
||||||
err = snd_config_remove(n);
|
err = snd_config_remove(n);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue