1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
--- gmix/gmix.c.orig Tue May 7 00:43:15 2002
+++ gmix/gmix.c Tue May 7 00:47:38 2002
@@ -60,7 +60,7 @@
#ifdef HAVE_LINUX_SOUNDCARD_H
#include <linux/soundcard.h>
#else
-#include <machine/soundcard.h>
+#include <sys/soundcard.h>
#endif
#endif
@@ -569,12 +569,7 @@
/*
* open the mixer-device
*/
- if (num == 0) {
- sprintf (device_name, "/dev/mixer");
- } else {
- sprintf (device_name, "/dev/mixer%i", num);
- }
-
+ sprintf(device_name, "/dev/mixer%i", num);
new_device->fd = open (device_name, O_RDWR, 0);
if (new_device->fd < 0) {
@@ -689,6 +684,7 @@
cnt = 0;
devices = NULL;
+ num_mixers = 0;
device_by_name = g_hash_table_new (g_str_hash, g_str_equal);
do {
@@ -697,9 +693,8 @@
devices = g_list_append (devices, new_device);
g_hash_table_insert (device_by_name, new_device->info.name, new_device);
}
- } while (new_device);
-
- num_mixers = cnt - 1;
+ } while ((errno == EACCES) || (errno == EINVAL) || (errno == ENXIO) \
+ || new_device);
}
device_info *
|