aboutsummaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authormarcus <marcus@FreeBSD.org>2008-08-10 14:50:52 +0800
committermarcus <marcus@FreeBSD.org>2008-08-10 14:50:52 +0800
commit97c00b363314939edcfff5a32884923bd81b3ffc (patch)
treee37a61bfa7aabc623116e2e023186c4f4049c535 /audio
parent8b8f194a1742e1d8596c8e0c2116b91cceee79b1 (diff)
downloadfreebsd-ports-graphics-97c00b363314939edcfff5a32884923bd81b3ffc.tar.gz
freebsd-ports-graphics-97c00b363314939edcfff5a32884923bd81b3ffc.tar.zst
freebsd-ports-graphics-97c00b363314939edcfff5a32884923bd81b3ffc.zip
Properly set the number of channels and sound format options.
Diffstat (limited to 'audio')
-rw-r--r--audio/libcanberra/Makefile2
-rw-r--r--audio/libcanberra/files/patch-src_oss.c27
2 files changed, 21 insertions, 8 deletions
diff --git a/audio/libcanberra/Makefile b/audio/libcanberra/Makefile
index 9456c9e4710..2100caaafe8 100644
--- a/audio/libcanberra/Makefile
+++ b/audio/libcanberra/Makefile
@@ -7,7 +7,7 @@
PORTNAME= libcanberra
PORTVERSION= 0.6
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= audio devel
MASTER_SITES= http://0pointer.de/public/
diff --git a/audio/libcanberra/files/patch-src_oss.c b/audio/libcanberra/files/patch-src_oss.c
index 4da6d334793..8fee452883b 100644
--- a/audio/libcanberra/files/patch-src_oss.c
+++ b/audio/libcanberra/files/patch-src_oss.c
@@ -1,6 +1,6 @@
---- src/oss.c.orig 2008-08-09 16:04:21.964956000 -0400
-+++ src/oss.c 2008-08-09 16:41:45.000000000 -0400
-@@ -0,0 +1,462 @@
+--- src/oss.c.orig 2008-08-10 01:57:54.353155000 -0400
++++ src/oss.c 2008-08-10 02:12:43.640204000 -0400
+@@ -0,0 +1,475 @@
+/***
+ This file is part of libcanberra.
+
@@ -224,8 +224,6 @@
+ }
+}
+
-+#define SAMPLE_FORMAT AFMT_S16_NE
-+
+static int open_oss(ca_context *c, struct outstanding *out) {
+ struct private *p;
+ int mode;
@@ -245,11 +243,26 @@
+ mode &= ~O_NONBLOCK;
+ fcntl(out->pcm, F_SETFL, mode);
+
-+ val = SAMPLE_FORMAT;
++ switch (ca_sound_file_get_sample_type(out->file)) {
++ case CA_SAMPLE_U8:
++ val = AFMT_U8;
++ break;
++ case CA_SAMPLE_S16NE:
++ val = AFMT_S16_NE;
++ break;
++ case CA_SAMPLE_S16RE:
++#if _BYTE_ORDER == _LITTLE_ENDIAN
++ val = AFMT_S16_BE;
++#else
++ val = AFMT_S16_LE;
++#endif
++ break;
++ }
++
+ if (ioctl(out->pcm, SNDCTL_DSP_SETFMT, &val) < 0)
+ goto finish;
+
-+ val = 1;
++ val = ca_sound_file_get_nchannels(out->file) > 1 ? 1 : 0;
+ if (ioctl(out->pcm, SNDCTL_DSP_STEREO, &val) < 0)
+ goto finish;
+