View | Details | Raw Unified | Return to bug 236118 | Differences between
and this patch

Collapse All | Expand All

(-)audio/portaudio/files/patch-src_hostapi_oss_pa__unix__oss.c (-16 / +22 lines)
Lines 1-4 Link Here
1
--- src/hostapi/oss/pa_unix_oss.c.orig	2018-07-17 07:24:21 UTC
1
--- src/hostapi/oss/pa_unix_oss.c.orig	2016-10-30 01:23:04 UTC
2
+++ src/hostapi/oss/pa_unix_oss.c
2
+++ src/hostapi/oss/pa_unix_oss.c
3
@@ -62,6 +62,9 @@
3
@@ -62,6 +62,9 @@
4
 #include <sys/poll.h>
4
 #include <sys/poll.h>
Lines 10-31 Link Here
10
 
10
 
11
 #ifdef HAVE_SYS_SOUNDCARD_H
11
 #ifdef HAVE_SYS_SOUNDCARD_H
12
 # include <sys/soundcard.h>
12
 # include <sys/soundcard.h>
13
@@ -525,7 +528,14 @@ static PaError BuildDeviceList( PaOSSHostApiRepresenta
13
@@ -525,6 +528,15 @@ static PaError BuildDeviceList( PaOSSHos
14
     int i;
14
     int i;
15
     int numDevices = 0, maxDeviceInfos = 1;
15
     int numDevices = 0, maxDeviceInfos = 1;
16
     PaDeviceInfo **deviceInfos = NULL;
16
     PaDeviceInfo **deviceInfos = NULL;
17
+    int basenameClone = 0;
17
+    int defaultDevice = 0;
18
+    int defaultDevice = 0;
18
 
19
+
19
+#ifdef __FreeBSD__
20
+#ifdef __FreeBSD__
20
+    size_t len = sizeof(defaultDevice);
21
+    size_t len = sizeof(basenameClone);
21
+    if (sysctlbyname("hw.snd.default_unit", &defaultDevice, &len, NULL, 0) == -1 || len != 4)
22
+    if (sysctlbyname("hw.snd.basename_clone", &basenameClone, &len, NULL, 0) == -1 || len != 4)
22
+       defaultDevice = 0;
23
+       basenameClone = 0;
24
+    defaultDevice = -1;
23
+#endif
25
+#endif
24
+
26
 
25
     /* These two will be set to the first working input and output device, respectively */
27
     /* These two will be set to the first working input and output device, respectively */
26
     commonApi->info.defaultInputDevice = paNoDevice;
28
     commonApi->info.defaultInputDevice = paNoDevice;
27
     commonApi->info.defaultOutputDevice = paNoDevice;
29
@@ -535,13 +547,13 @@ static PaError BuildDeviceList( PaOSSHos
28
@@ -541,7 +551,7 @@ static PaError BuildDeviceList( PaOSSHostApiRepresenta
30
      * add it to a linked list.
31
      * A: Set an arbitrary of 100 devices, should probably be a smarter way. */
32
 
33
-    for( i = 0; i < 100; i++ )
34
+    for( i = (basenameClone ? -1 : 0); i < 100; i++ )
35
     {
36
        char deviceName[32];
29
        PaDeviceInfo *deviceInfo;
37
        PaDeviceInfo *deviceInfo;
30
        int testResult;
38
        int testResult;
31
 
39
 
Lines 34-45 Link Here
34
           snprintf(deviceName, sizeof (deviceName), "%s", DEVICE_NAME_BASE);
42
           snprintf(deviceName, sizeof (deviceName), "%s", DEVICE_NAME_BASE);
35
        else
43
        else
36
           snprintf(deviceName, sizeof (deviceName), "%s%d", DEVICE_NAME_BASE, i);
44
           snprintf(deviceName, sizeof (deviceName), "%s%d", DEVICE_NAME_BASE, i);
37
@@ -2041,5 +2051,29 @@ static signed long GetStreamWriteAvailable( PaStream* 
45
@@ -2043,3 +2055,27 @@ error:
38
 error:
39
     return result;
40
 #endif
46
 #endif
41
+}
47
 }
42
+
48
 
43
+const char *PaOSS_GetStreamInputDevice( PaStream* s )
49
+const char *PaOSS_GetStreamInputDevice( PaStream* s )
44
+{
50
+{
45
+    PaOssStream *stream = (PaOssStream*)s;
51
+    PaOssStream *stream = (PaOssStream*)s;
Lines 62-66 Link Here
62
+    }
68
+    }
63
+
69
+
64
+   return NULL;
70
+   return NULL;
65
 }
71
+}
66
 
72
+

Return to bug 236118