diff options
-rw-r--r-- | www/palemoon/Makefile | 1 | ||||
-rw-r--r-- | www/palemoon/files/patch-cubeb5ffce9e91b | 41 |
2 files changed, 42 insertions, 0 deletions
diff --git a/www/palemoon/Makefile b/www/palemoon/Makefile index fa3f803f9ed6..600de38adb3c 100644 --- a/www/palemoon/Makefile +++ b/www/palemoon/Makefile @@ -4,6 +4,7 @@ PORTNAME= palemoon DISTVERSION= 27.6.2 DISTVERSIONSUFFIX=_Release +PORTREVISION= 1 CATEGORIES= www ipv6 MAINTAINER= lichray@gmail.com diff --git a/www/palemoon/files/patch-cubeb5ffce9e91b b/www/palemoon/files/patch-cubeb5ffce9e91b new file mode 100644 index 000000000000..65b1c9129396 --- /dev/null +++ b/www/palemoon/files/patch-cubeb5ffce9e91b @@ -0,0 +1,41 @@ +From 5ffce9e91b2fde70ba532ea215e3e9e7eed3d41a Mon Sep 17 00:00:00 2001 +From: Alexandre Ratchov <alex@caoua.org> +Date: Thu, 2 Apr 2015 13:09:22 +1300 +Subject: [PATCH] sndio: improve and clamp float->s16 conversion. + +--- + src/cubeb_sndio.c | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +diff --git a/src/cubeb_sndio.c b/src/cubeb_sndio.c +index 01f96346..e6d531a4 100644 +--- media/libcubeb/src/cubeb_sndio.c.orig ++++ media/libcubeb/src/cubeb_sndio.c +@@ -4,6 +4,7 @@ + * This program is made available under an ISC-style license. See the + * accompanying file LICENSE for details. + */ ++#include <math.h> + #include <poll.h> + #include <pthread.h> + #include <sndio.h> +@@ -49,9 +50,16 @@ float_to_s16(void *ptr, long nsamp) + { + int16_t *dst = ptr; + float *src = ptr; +- +- while (nsamp-- > 0) +- *(dst++) = *(src++) * 32767; ++ int s; ++ ++ while (nsamp-- > 0) { ++ s = lrintf(*(src++) * 32768); ++ if (s < -32768) ++ s = -32768; ++ else if (s > 32767) ++ s = 32767; ++ *(dst++) = s; ++ } + } + + static void |