aboutsummaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorkevlo <kevlo@FreeBSD.org>2016-08-04 15:24:01 +0800
committerkevlo <kevlo@FreeBSD.org>2016-08-04 15:24:01 +0800
commit3188c82633f3d3202cbc67c463140763c1f8a82a (patch)
tree1a6c31d398e468ed5477d3941c486ff52e468c9c /audio
parent7cf9f4ddcb34f76a88aeb6ff5a00970ff9fae5a8 (diff)
downloadfreebsd-ports-gnome-3188c82633f3d3202cbc67c463140763c1f8a82a.tar.gz
freebsd-ports-gnome-3188c82633f3d3202cbc67c463140763c1f8a82a.tar.zst
freebsd-ports-gnome-3188c82633f3d3202cbc67c463140763c1f8a82a.zip
Support hw.snd.default_unit sysctl.
If the hw.snd.default_unit is set to anything except zero, /dev/dsp0 is not available to programs using portaudio, since it assumes that /dev/dsp and /dev/dsp0 are the same device. PR: 208968 Submitted by: shurd Approved by: koalative@gmail.com (maintainer timeout)
Diffstat (limited to 'audio')
-rw-r--r--audio/portaudio/Makefile2
-rw-r--r--audio/portaudio/files/patch-src_hostapi_oss_pa__unix__oss.c35
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);