From owner-svn-ports-head@freebsd.org Sun Dec 3 07:17:19 2017 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A151DF16D5; Sun, 3 Dec 2017 07:17:19 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B8F26EAE8; Sun, 3 Dec 2017 07:17:19 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vB37HI6S014932; Sun, 3 Dec 2017 07:17:18 GMT (envelope-from tobik@FreeBSD.org) Received: (from tobik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vB37HIsn014930; Sun, 3 Dec 2017 07:17:18 GMT (envelope-from tobik@FreeBSD.org) Message-Id: <201712030717.vB37HIsn014930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tobik set sender to tobik@FreeBSD.org using -f From: Tobias Kortkamp Date: Sun, 3 Dec 2017 07:17:18 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r455391 - in head/www/palemoon: . files X-SVN-Group: ports-head X-SVN-Commit-Author: tobik X-SVN-Commit-Paths: in head/www/palemoon: . files X-SVN-Commit-Revision: 455391 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Dec 2017 07:17:19 -0000 Author: tobik Date: Sun Dec 3 07:17:18 2017 New Revision: 455391 URL: https://svnweb.freebsd.org/changeset/ports/455391 Log: www/palemoon: sndio: improve and clamp float->s16 conversion This fixes sound glitches/crackling when playing audio or video clips with float samples with SNDIO=on. PR: 224034 Submitted by: lichray@gmail.com (maintainer) Obtained from: cubeb Added: head/www/palemoon/files/patch-cubeb5ffce9e91b (contents, props changed) Modified: head/www/palemoon/Makefile Modified: head/www/palemoon/Makefile ============================================================================== --- head/www/palemoon/Makefile Sun Dec 3 07:15:48 2017 (r455390) +++ head/www/palemoon/Makefile Sun Dec 3 07:17:18 2017 (r455391) @@ -4,6 +4,7 @@ PORTNAME= palemoon DISTVERSION= 27.6.2 DISTVERSIONSUFFIX=_Release +PORTREVISION= 1 CATEGORIES= www ipv6 MAINTAINER= lichray@gmail.com Added: head/www/palemoon/files/patch-cubeb5ffce9e91b ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/palemoon/files/patch-cubeb5ffce9e91b Sun Dec 3 07:17:18 2017 (r455391) @@ -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