mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-28 01:40:08 -05:00
conf: merge card specific contents per file (whole) after parsing
Unfortunately, mentioned fix caused a regression for items stored in one file.
Merge the file contents after parsing not inside parsing process.
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=2420645
Fixes: eda76146 ("conf: fix load_for_all_cards() - do not merge the card specific contents")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
813ffe34ff
commit
a6238053c4
1 changed files with 10 additions and 3 deletions
13
src/conf.c
13
src/conf.c
|
|
@ -4119,14 +4119,21 @@ static int config_filename_filter(const struct dirent64 *dirent)
|
||||||
static int config_file_open(snd_config_t *root, const char *filename, int merge)
|
static int config_file_open(snd_config_t *root, const char *filename, int merge)
|
||||||
{
|
{
|
||||||
snd_input_t *in;
|
snd_input_t *in;
|
||||||
|
snd_config_t *top;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
err = snd_input_stdio_open(&in, filename, "r");
|
err = snd_input_stdio_open(&in, filename, "r");
|
||||||
if (err >= 0) {
|
if (err >= 0) {
|
||||||
if (merge)
|
if (merge) {
|
||||||
err = snd_config_load(root, in);
|
err = snd_config_load(root, in);
|
||||||
else
|
} else {
|
||||||
err = snd_config_load_override(root, in);
|
err = snd_config_top(&top);
|
||||||
|
if (err >= 0) {
|
||||||
|
err = snd_config_load(top, in);
|
||||||
|
if (err >= 0)
|
||||||
|
err = snd_config_merge(root, top, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
snd_input_close(in);
|
snd_input_close(in);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
snd_error(CORE, "%s may be old or corrupted: consider to remove or fix it", filename);
|
snd_error(CORE, "%s may be old or corrupted: consider to remove or fix it", filename);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue