View | Details | Raw Unified | Return to bug 208968
Collapse All | Expand All

(-)Makefile (-1 / +1 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	portaudio
4
PORTNAME=	portaudio
5
DISTVERSION=	19_20140130
5
DISTVERSION=	19_20140130
6
PORTREVISION=	3
6
PORTREVISION=	4
7
CATEGORIES=	audio
7
CATEGORIES=	audio
8
MASTER_SITES=	http://www.portaudio.com/archives/
8
MASTER_SITES=	http://www.portaudio.com/archives/
9
DISTNAME=	pa_stable_v${DISTVERSION}
9
DISTNAME=	pa_stable_v${DISTVERSION}
(-)files/patch-src_hostapi_oss_pa__unix__oss.c (+35 lines)
Line 0 Link Here
1
--- src/hostapi/oss/pa_unix_oss.c.orig	2013-06-08 19:30:41 UTC
2
+++ src/hostapi/oss/pa_unix_oss.c
3
@@ -62,6 +62,9 @@
4
 #include <sys/poll.h>
5
 #include <limits.h>
6
 #include <semaphore.h>
7
+#ifdef __FreeBSD__
8
+#include <sys/sysctl.h>
9
+#endif
10
 
11
 #ifdef HAVE_SYS_SOUNDCARD_H
12
 # include <sys/soundcard.h>
13
@@ -525,6 +528,13 @@ static PaError BuildDeviceList( PaOSSHos
14
     int i;
15
     int numDevices = 0, maxDeviceInfos = 1;
16
     PaDeviceInfo **deviceInfos = NULL;
17
+    int defaultDevice = 0;
18
+
19
+#ifdef __FreeBSD__
20
+    size_t len = sizeof(defaultDevice);
21
+    if (sysctlbyname("hw.snd.default_unit", &defaultDevice, &len, NULL, 0) == -1 || len != 4)
22
+       defaultDevice = 0;
23
+#endif
24
 
25
     /* These two will be set to the first working input and output device, respectively */
26
     commonApi->info.defaultInputDevice = paNoDevice;
27
@@ -541,7 +551,7 @@ static PaError BuildDeviceList( PaOSSHos
28
        PaDeviceInfo *deviceInfo;
29
        int testResult;
30
 
31
-       if( i == 0 )
32
+       if( i == defaultDevice )
33
           snprintf(deviceName, sizeof (deviceName), "%s", DEVICE_NAME_BASE);
34
        else
35
           snprintf(deviceName, sizeof (deviceName), "%s%d", DEVICE_NAME_BASE, i);

Return to bug 208968