--- Makefile (revision 455341) +++ Makefile (working copy) @@ -4,6 +4,7 @@ PORTNAME= palemoon DISTVERSION= 27.6.2 DISTVERSIONSUFFIX=_Release +PORTREVISION= 1 CATEGORIES= www ipv6 MAINTAINER= lichray@gmail.com --- files/patch-cubeb5ffce9e91b (nonexistent) +++ files/patch-cubeb5ffce9e91b (working copy) @@ -0,0 +1,41 @@ +From 5ffce9e91b2fde70ba532ea215e3e9e7eed3d41a Mon Sep 17 00:00:00 2001 +From: Alexandre Ratchov +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 + #include + #include + #include +@@ -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