summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-11-26 13:59:19 +0100
committerTakashi Iwai <tiwai@suse.de>2013-11-26 13:59:19 +0100
commitbb3293c76e6a1a130196ccb86e78aea3322ed735 (patch)
treec8c5ff7e09cb4425e3895bf51c527b8a10943a32
parentd2d9b6fc8d20fca1e06fc261ac20fd6cfd8a8d1b (diff)
downloadalsa-utils-bb3293c76e6a1a130196ccb86e78aea3322ed735.tar.gz
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>
-rw-r--r--alsactl/monitor.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/alsactl/monitor.c b/alsactl/monitor.c
index 12d2450..1c02468 100644
--- a/alsactl/monitor.c
+++ b/alsactl/monitor.c
@@ -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);