mixer/alsa: handle ENODEV

Fixes busy loop when USB sound device gets unplugged (Mantis bug
#3824).
This commit is contained in:
Max Kellermann 2013-10-01 16:33:07 +02:00
parent 72ef38d4a7
commit 9a1076256d
2 changed files with 7 additions and 0 deletions

2
NEWS
View File

@ -1,4 +1,6 @@
ver 0.17.6 (not yet released) ver 0.17.6 (not yet released)
* mixer:
- alsa: fix busy loop when USB sound device gets unplugged
ver 0.17.5 (2013/08/04) ver 0.17.5 (2013/08/04)
* protocol: * protocol:

View File

@ -182,6 +182,11 @@ alsa_mixer_source_dispatch(GSource *_source,
if (err < 0) { if (err < 0) {
g_warning("snd_mixer_handle_events() failed: %s", g_warning("snd_mixer_handle_events() failed: %s",
snd_strerror(err)); snd_strerror(err));
if (err == -ENODEV)
/* the sound device was unplugged; disable
this GSource */
return false;
} }
return true; return true;