mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
simple mixer - fix error recovery path for volume / switch write
If volume or switch write fails, the internal contents for element is changed, but it is wrong. Reread the whole simple element in this case to get correct values.
This commit is contained in:
parent
f87356d8f0
commit
275afa4d70
1 changed files with 11 additions and 1 deletions
|
|
@ -515,7 +515,7 @@ static int elem_write_enum(selem_none_t *s)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int selem_write(snd_mixer_elem_t *elem)
|
||||
static int selem_write_main(snd_mixer_elem_t *elem)
|
||||
{
|
||||
selem_none_t *s;
|
||||
unsigned int idx;
|
||||
|
|
@ -598,6 +598,16 @@ static int selem_write(snd_mixer_elem_t *elem)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int selem_write(snd_mixer_elem_t *elem)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = selem_write_main(elem);
|
||||
if (err < 0)
|
||||
selem_read(elem);
|
||||
return err;
|
||||
}
|
||||
|
||||
static void selem_free(snd_mixer_elem_t *elem)
|
||||
{
|
||||
selem_none_t *simple = snd_mixer_elem_get_private(elem);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue