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>
Jaroslav Kysela
3 years ago
148 | 148 | } |
149 | 149 | |
150 | 150 | idx = 0; |
151 | ||
152 | /* for array, use a temporary non-clashing identifier */ | |
153 | if (array > 0) { | |
154 | snd_config_for_each(i, next, dst) { | |
155 | n = snd_config_iterator_entry(i); | |
156 | snprintf(tmpid, sizeof(tmpid), "_tmp_%d", idx++); | |
157 | err = snd_config_set_id(n, tmpid); | |
158 | if (err < 0) | |
159 | return err; | |
160 | } | |
161 | } | |
162 | ||
151 | 163 | snd_config_for_each(i, next, src) { |
152 | 164 | n = snd_config_iterator_entry(i); |
153 | 165 | err = snd_config_remove(n); |