aboutsummaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authorJoe Marcus Clarke <marcus@FreeBSD.org>2008-08-10 06:50:52 +0000
committerJoe Marcus Clarke <marcus@FreeBSD.org>2008-08-10 06:50:52 +0000
commit39c23b13424f1681963272d4dc788f2ece1f7f8d (patch)
tree6037fc4b354cb88d7de29f2035de725d029f1a87 /audio
parent011a2d205a9531edb75a0a60bf768a2ba62b2185 (diff)
downloadports-39c23b13424f1681963272d4dc788f2ece1f7f8d.tar.gz
ports-39c23b13424f1681963272d4dc788f2ece1f7f8d.zip
Notes
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 9456c9e47101..2100caaafe80 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 4da6d334793c..8fee452883b7 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;
+