mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-10 00:45:41 +01:00
alsactl: Fix REMOVE event handling in monitor command
SND_CTL_EVENT_MASK_REMOVE has to be checked at first and ignore the rest if it matches. Suggested by Clemens. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
d2d9b6fc8d
commit
bb3293c76e
1 changed files with 4 additions and 2 deletions
|
@ -58,6 +58,10 @@ int monitor(const char *name)
|
|||
snd_ctl_event_elem_get_index(event));
|
||||
|
||||
mask = snd_ctl_event_elem_get_mask(event);
|
||||
if (mask == SND_CTL_EVENT_MASK_REMOVE) {
|
||||
printf(" REMOVE\n");
|
||||
continue;
|
||||
}
|
||||
if (mask & SND_CTL_EVENT_MASK_VALUE)
|
||||
printf(" VALUE");
|
||||
if (mask & SND_CTL_EVENT_MASK_INFO)
|
||||
|
@ -66,8 +70,6 @@ int monitor(const char *name)
|
|||
printf(" ADD");
|
||||
if (mask & SND_CTL_EVENT_MASK_TLV)
|
||||
printf(" TLV");
|
||||
if (mask == SND_CTL_EVENT_MASK_REMOVE)
|
||||
printf(" REMOVE");
|
||||
printf("\n");
|
||||
}
|
||||
snd_ctl_close(ctl);
|
||||
|
|
Loading…
Reference in a new issue