svn commit: r419598 - in head/audio/portaudio: . files
Kevin Lo
kevlo at FreeBSD.org
Thu Aug 4 07:24:02 UTC 2016
Author: kevlo
Date: Thu Aug 4 07:24:01 2016
New Revision: 419598
URL: https://svnweb.freebsd.org/changeset/ports/419598
Log:
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 at gmail.com (maintainer timeout)
Added:
head/audio/portaudio/files/
head/audio/portaudio/files/patch-src_hostapi_oss_pa__unix__oss.c (contents, props changed)
Modified:
head/audio/portaudio/Makefile
Modified: head/audio/portaudio/Makefile
==============================================================================
--- head/audio/portaudio/Makefile Thu Aug 4 06:16:18 2016 (r419597)
+++ head/audio/portaudio/Makefile Thu Aug 4 07:24:01 2016 (r419598)
@@ -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}
Added: head/audio/portaudio/files/patch-src_hostapi_oss_pa__unix__oss.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/audio/portaudio/files/patch-src_hostapi_oss_pa__unix__oss.c Thu Aug 4 07:24:01 2016 (r419598)
@@ -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);
More information about the svn-ports-all
mailing list