aboutsummaryrefslogtreecommitdiff
path: root/audio/openal
diff options
context:
space:
mode:
authorOliver Lehmann <oliver@FreeBSD.org>2006-04-23 19:46:44 +0000
committerOliver Lehmann <oliver@FreeBSD.org>2006-04-23 19:46:44 +0000
commit22509b8214c4634e7b0eccb65d4d1b768bf25250 (patch)
tree2df7bd0a89f542e68edaf8de1bd52759faf681b5 /audio/openal
parent43e9730a966f921564cefb42aca1c419b71f42ce (diff)
downloadports-22509b8214c4634e7b0eccb65d4d1b768bf25250.tar.gz
ports-22509b8214c4634e7b0eccb65d4d1b768bf25250.zip
fix oss support
bump portrevision
Notes
Notes: svn path=/head/; revision=160250
Diffstat (limited to 'audio/openal')
-rw-r--r--audio/openal/Makefile1
-rw-r--r--audio/openal/files/patch-src-backends-alc_backend_bsd.c56
2 files changed, 57 insertions, 0 deletions
diff --git a/audio/openal/Makefile b/audio/openal/Makefile
index 93a713622d29..a6ba934ed371 100644
--- a/audio/openal/Makefile
+++ b/audio/openal/Makefile
@@ -7,6 +7,7 @@
PORTNAME= openal
PORTVERSION= 20060211
+PORTREVISION= 1
CATEGORIES= audio
MASTER_SITES= http://openal.org/openal_webstf/downloads/
DISTVERSION= 0.0.8
diff --git a/audio/openal/files/patch-src-backends-alc_backend_bsd.c b/audio/openal/files/patch-src-backends-alc_backend_bsd.c
index 8ee8e3c19c6b..8de0a05ce023 100644
--- a/audio/openal/files/patch-src-backends-alc_backend_bsd.c
+++ b/audio/openal/files/patch-src-backends-alc_backend_bsd.c
@@ -11,3 +11,59 @@
#include <assert.h>
#include <fcntl.h>
#include <sys/soundcard.h>
+@@ -113,7 +114,6 @@
+ */
+ static void *grab_write_native(void) {
+ const char *dsppath = "/dev/dsp";
+- int divisor = _alSpot(_AL_DEF_BUFSIZ) | (2<<16);
+
+ dsp_fd = open(dsppath, O_WRONLY | O_NONBLOCK);
+
+@@ -126,10 +126,6 @@
+ perror("fcntl");
+ }
+
+- if(ioctl(dsp_fd, SNDCTL_DSP_SETFRAGMENT, &divisor) < 0) {
+- perror("ioctl SETFRAGMENT");
+- }
+-
+ FD_ZERO(&dsp_fd_set);
+ FD_SET(dsp_fd, &dsp_fd_set);
+
+@@ -318,10 +314,11 @@
+ }
+
+ static ALboolean set_write_native(UNUSED(void *handle),
+- UNUSED(unsigned int *bufsiz),
++ unsigned int *bufsiz,
+ ALenum *fmt,
+ unsigned int *speed) {
+ ALuint channels = _alGetChannelsFromFormat(*fmt);
++ int divisor;
+
+ if(dsp_fd < 0) {
+ return AL_FALSE;
+@@ -363,6 +360,23 @@
+
+
+ *fmt = BSD2ALFMT(*fmt, channels);
++
++ if(ioctl(dsp_fd, SNDCTL_DSP_GETBLKSIZE, bufsiz) < 0) {
++#ifdef DEBUG_MAXIMUS
++ fprintf(stderr, "blksize %d\n", *bufsiz);
++ perror("get_devsp blksize ioctl");
++#endif
++ return AL_FALSE;
++ }
++
++ divisor = _alSpot(*bufsiz) | (2<<16);
++ if(ioctl(dsp_fd, SNDCTL_DSP_SETFRAGMENT, &divisor) < 0) {
++#ifdef DEBUG_MAXIMUS
++ fprintf(stderr, "divisor %d\n", divisor);
++ perror("set_devsp fragment ioctl");
++#endif
++ return AL_FALSE;
++ }
+
+ return AL_TRUE;
+ }