Call card_destroy_callback() when an ALSA element is removed
This commit is contained in:
@@ -811,12 +811,18 @@ static gboolean alsa_card_callback(
|
||||
printf("card_callback_error %d\n", err);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (snd_ctl_event_get_type(event) != SND_CTL_EVENT_ELEM)
|
||||
return 1;
|
||||
|
||||
int numid = snd_ctl_event_elem_get_numid(event);
|
||||
unsigned int mask = snd_ctl_event_elem_get_mask(event);
|
||||
|
||||
if (mask == SND_CTL_EVENT_MASK_REMOVE) {
|
||||
card_destroy_callback(card);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!(mask & (SND_CTL_EVENT_MASK_VALUE | SND_CTL_EVENT_MASK_INFO)))
|
||||
return 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user