mirror of
https://github.com/apache/nuttx.git
synced 2026-08-16 18:03:19 +00:00
sim/alsa: don't let siwtch out when open alsa mixer
Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
parent
c74627cbec
commit
f2de1ce930
1 changed files with 4 additions and 1 deletions
|
|
@ -772,12 +772,13 @@ out:
|
|||
static int sim_mixer_open(struct sim_audio_s *priv)
|
||||
{
|
||||
snd_mixer_selem_id_t *sid = NULL;
|
||||
irqstate_t flags = up_irq_save();
|
||||
int ret;
|
||||
|
||||
ret = snd_mixer_open(&priv->mixer, 0);
|
||||
if (ret < 0)
|
||||
{
|
||||
return ret;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
ret = snd_mixer_attach(priv->mixer, "default");
|
||||
|
|
@ -841,9 +842,11 @@ static int sim_mixer_open(struct sim_audio_s *priv)
|
|||
}
|
||||
}
|
||||
|
||||
up_irq_restore(flags);
|
||||
return 0;
|
||||
fail:
|
||||
snd_mixer_close(priv->mixer);
|
||||
up_irq_restore(flags);
|
||||
priv->mixer = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue