diff options
author | Max Kellermann <max@duempel.org> | 2013-10-01 16:33:07 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-10-01 16:35:27 +0200 |
commit | 9a1076256deef8bf806942eb72eabdbfdf74ddb3 (patch) | |
tree | 0a322f60d84767f462a3f8dae5f5780c38bc64d1 /src/mixer | |
parent | 72ef38d4a73c13b2278ac90e76df4247a633579d (diff) | |
download | mpd-9a1076256deef8bf806942eb72eabdbfdf74ddb3.tar.gz mpd-9a1076256deef8bf806942eb72eabdbfdf74ddb3.tar.xz mpd-9a1076256deef8bf806942eb72eabdbfdf74ddb3.zip |
mixer/alsa: handle ENODEV
Fixes busy loop when USB sound device gets unplugged (Mantis bug
#3824).
Diffstat (limited to 'src/mixer')
-rw-r--r-- | src/mixer/alsa_mixer_plugin.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mixer/alsa_mixer_plugin.c b/src/mixer/alsa_mixer_plugin.c index cecf44db9..0c8625cc1 100644 --- a/src/mixer/alsa_mixer_plugin.c +++ b/src/mixer/alsa_mixer_plugin.c @@ -182,6 +182,11 @@ alsa_mixer_source_dispatch(GSource *_source, if (err < 0) { g_warning("snd_mixer_handle_events() failed: %s", snd_strerror(err)); + + if (err == -ENODEV) + /* the sound device was unplugged; disable + this GSource */ + return false; } return true; |