openbsd-ports/sysutils/xstatbar/patches/patch-stats_c
ajacoutot 816c6f0d56 Prevent xstatbar to hang on startup with some audio chip:
if devinfo.type != AUDIO_MIXER_CLASS is true, xstatbar will never make
progress and loop forever. Fix it by trying the next device.

from Tobias Ulmer, thanks!
ok jasper@ landry@
2011-08-02 15:17:43 +00:00

20 lines
679 B
Plaintext

$OpenBSD: patch-stats_c,v 1.5 2011/08/02 15:17:43 ajacoutot Exp $
If devinfo.type != AUDIO_MIXER_CLASS is true, xstatbar will never make
progress and loop forever. Fix it by trying the next device.
--- stats.c.orig Tue Aug 2 17:10:04 2011
+++ stats.c Tue Aug 2 17:11:47 2011
@@ -101,8 +101,10 @@ volume_init()
devinfo.index = 0;
while (ioctl(volume.dev_fd, AUDIO_MIXER_DEVINFO, &devinfo) >= 0) {
- if (devinfo.type != AUDIO_MIXER_CLASS)
+ if (devinfo.type != AUDIO_MIXER_CLASS) {
+ devinfo.index++;
continue;
+ }
if (strncmp(devinfo.label.name, AudioCoutputs, MAX_AUDIO_DEV_LEN) == 0)
oclass_idx = devinfo.index;