diff options
author | Kevin Lo <kevlo@FreeBSD.org> | 2016-08-04 07:24:01 +0000 |
---|---|---|
committer | Kevin Lo <kevlo@FreeBSD.org> | 2016-08-04 07:24:01 +0000 |
commit | a291f8859215f3b9bc2a15cfebcd3329b67a6db3 (patch) | |
tree | 1a6c31d398e468ed5477d3941c486ff52e468c9c /audio/portaudio | |
parent | 9c26236a3157029c8a364234ff01995be0ee2fe8 (diff) |
Notes
Diffstat (limited to 'audio/portaudio')
-rw-r--r-- | audio/portaudio/Makefile | 2 | ||||
-rw-r--r-- | audio/portaudio/files/patch-src_hostapi_oss_pa__unix__oss.c | 35 |
2 files changed, 36 insertions, 1 deletions
diff --git a/audio/portaudio/Makefile b/audio/portaudio/Makefile index 532647cd0262..57a349736e5b 100644 --- a/audio/portaudio/Makefile +++ b/audio/portaudio/Makefile @@ -3,7 +3,7 @@ PORTNAME= portaudio DISTVERSION= 19_20140130 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= audio MASTER_SITES= http://www.portaudio.com/archives/ DISTNAME= pa_stable_v${DISTVERSION} diff --git a/audio/portaudio/files/patch-src_hostapi_oss_pa__unix__oss.c b/audio/portaudio/files/patch-src_hostapi_oss_pa__unix__oss.c new file mode 100644 index 000000000000..7bc4cc1d15df --- /dev/null +++ b/audio/portaudio/files/patch-src_hostapi_oss_pa__unix__oss.c @@ -0,0 +1,35 @@ +--- src/hostapi/oss/pa_unix_oss.c.orig 2013-06-08 19:30:41 UTC ++++ src/hostapi/oss/pa_unix_oss.c +@@ -62,6 +62,9 @@ + #include <sys/poll.h> + #include <limits.h> + #include <semaphore.h> ++#ifdef __FreeBSD__ ++#include <sys/sysctl.h> ++#endif + + #ifdef HAVE_SYS_SOUNDCARD_H + # include <sys/soundcard.h> +@@ -525,6 +528,13 @@ static PaError BuildDeviceList( PaOSSHos + int i; + int numDevices = 0, maxDeviceInfos = 1; + PaDeviceInfo **deviceInfos = NULL; ++ int defaultDevice = 0; ++ ++#ifdef __FreeBSD__ ++ size_t len = sizeof(defaultDevice); ++ if (sysctlbyname("hw.snd.default_unit", &defaultDevice, &len, NULL, 0) == -1 || len != 4) ++ defaultDevice = 0; ++#endif + + /* These two will be set to the first working input and output device, respectively */ + commonApi->info.defaultInputDevice = paNoDevice; +@@ -541,7 +551,7 @@ static PaError BuildDeviceList( PaOSSHos + PaDeviceInfo *deviceInfo; + int testResult; + +- if( i == 0 ) ++ if( i == defaultDevice ) + snprintf(deviceName, sizeof (deviceName), "%s", DEVICE_NAME_BASE); + else + snprintf(deviceName, sizeof (deviceName), "%s%d", DEVICE_NAME_BASE, i); |