mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-04 04:06:26 -05:00
mixer: abst - reshuffle snd_mixer_simple_basic_register code to be more logical
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
b97a11ecf0
commit
f0679e5de2
1 changed files with 28 additions and 30 deletions
|
|
@ -305,38 +305,36 @@ int snd_mixer_simple_basic_register(snd_mixer_t *mixer,
|
|||
file = s;
|
||||
}
|
||||
err = snd_config_top(&top);
|
||||
if (err >= 0) {
|
||||
err = snd_input_stdio_open(&input, file, "r");
|
||||
if (err < 0) {
|
||||
snd_error(MIXER, "unable to open simple mixer configuration file '%s'", file);
|
||||
goto __error;
|
||||
}
|
||||
err = snd_config_load(top, input);
|
||||
snd_input_close(input);
|
||||
if (err < 0) {
|
||||
snd_error(MIXER, "%s may be old or corrupted: consider to remove or fix it", file);
|
||||
goto __error;
|
||||
}
|
||||
err = find_full(class, mixer, top, priv->device);
|
||||
if (err >= 0)
|
||||
goto __full;
|
||||
if (err < 0)
|
||||
goto __error;
|
||||
err = snd_input_stdio_open(&input, file, "r");
|
||||
if (err < 0) {
|
||||
snd_error(MIXER, "unable to open simple mixer configuration file '%s'", file);
|
||||
goto __error;
|
||||
}
|
||||
if (err >= 0) {
|
||||
err = snd_ctl_open(&priv->ctl, priv->device, 0);
|
||||
if (err < 0) {
|
||||
snd_error(MIXER, "unable to open control device '%s': %s", priv->device, snd_strerror(err));
|
||||
goto __error;
|
||||
}
|
||||
err = snd_hctl_open_ctl(&priv->hctl, priv->ctl);
|
||||
if (err < 0)
|
||||
goto __error;
|
||||
err = snd_ctl_card_info_malloc(&priv->info);
|
||||
if (err < 0)
|
||||
goto __error;
|
||||
err = snd_ctl_card_info(priv->ctl, priv->info);
|
||||
if (err < 0)
|
||||
goto __error;
|
||||
err = snd_config_load(top, input);
|
||||
snd_input_close(input);
|
||||
if (err < 0) {
|
||||
snd_error(MIXER, "%s may be old or corrupted: consider to remove or fix it", file);
|
||||
goto __error;
|
||||
}
|
||||
err = find_full(class, mixer, top, priv->device);
|
||||
if (err >= 0)
|
||||
goto __full;
|
||||
err = snd_ctl_open(&priv->ctl, priv->device, 0);
|
||||
if (err < 0) {
|
||||
snd_error(MIXER, "unable to open control device '%s': %s", priv->device, snd_strerror(err));
|
||||
goto __error;
|
||||
}
|
||||
err = snd_hctl_open_ctl(&priv->hctl, priv->ctl);
|
||||
if (err < 0)
|
||||
goto __error;
|
||||
err = snd_ctl_card_info_malloc(&priv->info);
|
||||
if (err < 0)
|
||||
goto __error;
|
||||
err = snd_ctl_card_info(priv->ctl, priv->info);
|
||||
if (err < 0)
|
||||
goto __error;
|
||||
if (err >= 0)
|
||||
err = find_module(class, top);
|
||||
if (err >= 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue