From owner-svn-ports-all@freebsd.org Sat Jun 30 19:25:34 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AE72FD523C; Sat, 30 Jun 2018 19:25:34 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D152F895B0; Sat, 30 Jun 2018 19:25:33 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF0591422E; Sat, 30 Jun 2018 19:25:33 +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 w5UJPXOD026914; Sat, 30 Jun 2018 19:25:33 GMT (envelope-from tobik@FreeBSD.org) Received: (from tobik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5UJPXTm026913; Sat, 30 Jun 2018 19:25:33 GMT (envelope-from tobik@FreeBSD.org) Message-Id: <201806301925.w5UJPXTm026913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tobik set sender to tobik@FreeBSD.org using -f From: Tobias Kortkamp Date: Sat, 30 Jun 2018 19:25:33 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r473631 - in head/mail/thunderbird: . files X-SVN-Group: ports-head X-SVN-Commit-Author: tobik X-SVN-Commit-Paths: in head/mail/thunderbird: . files X-SVN-Commit-Revision: 473631 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2018 19:25:34 -0000 Author: tobik Date: Sat Jun 30 19:25:32 2018 New Revision: 473631 URL: https://svnweb.freebsd.org/changeset/ports/473631 Log: mail/thunderbird: Backport sndio volume handling fix https://bugzilla.mozilla.org/show_bug.cgi?id=1467882 PR: 229135 Approved by: gecko (jbeich) Added: head/mail/thunderbird/files/patch-bug1467882 - copied unchanged from r473630, head/www/seamonkey/files/patch-bug1467882 Modified: head/mail/thunderbird/Makefile Modified: head/mail/thunderbird/Makefile ============================================================================== --- head/mail/thunderbird/Makefile Sat Jun 30 19:24:21 2018 (r473630) +++ head/mail/thunderbird/Makefile Sat Jun 30 19:25:32 2018 (r473631) @@ -3,7 +3,7 @@ PORTNAME= thunderbird DISTVERSION= 52.8.0 -PORTREVISION= 6 +PORTREVISION= 7 CATEGORIES= mail news net-im ipv6 MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \ MOZILLA/${PORTNAME}/candidates/${DISTVERSION}-candidates/build1/source Copied: head/mail/thunderbird/files/patch-bug1467882 (from r473630, head/www/seamonkey/files/patch-bug1467882) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/mail/thunderbird/files/patch-bug1467882 Sat Jun 30 19:25:32 2018 (r473631, copy of r473630, head/www/seamonkey/files/patch-bug1467882) @@ -0,0 +1,70 @@ +--- mozilla/media/libcubeb/src/cubeb_sndio.c.orig 2018-04-04 00:35:17 UTC ++++ mozilla/media/libcubeb/src/cubeb_sndio.c +@@ -43,17 +43,33 @@ struct cubeb_stream { + cubeb_data_callback data_cb; /* cb to preapare data */ + cubeb_state_callback state_cb; /* cb to notify about state changes */ + void *arg; /* user arg to {data,state}_cb */ ++ float volume; /* current volume */ + }; + + static void +-float_to_s16(void *ptr, long nsamp) ++s16_setvol(void *ptr, long nsamp, float volume) + { + int16_t *dst = ptr; ++ int32_t mult = volume * 32768; ++ int32_t s; ++ ++ while (nsamp-- > 0) { ++ s = *dst; ++ s = (s * mult) >> 15; ++ *(dst++) = s; ++ } ++} ++ ++static void ++float_to_s16(void *ptr, long nsamp, float volume) ++{ ++ int16_t *dst = ptr; + float *src = ptr; ++ float mult = volume * 32768; + int s; + + while (nsamp-- > 0) { +- s = lrintf(*(src++) * 32768); ++ s = lrintf(*(src++) * mult); + if (s < -32768) + s = -32768; + else if (s > 32767) +@@ -111,7 +127,9 @@ sndio_mainloop(void *arg) + break; + } + if (s->conv) +- float_to_s16(s->buf, nfr * s->pchan); ++ float_to_s16(s->buf, nfr * s->pchan, s->volume); ++ else ++ s16_setvol(s->buf, nfr * s->pchan, s->volume); + start = 0; + end = nfr * s->bpf; + } +@@ -260,6 +278,7 @@ sndio_stream_init(cubeb * context, + free(s); + return CUBEB_ERROR; + } ++ s->volume = 1.; + *stream = s; + DPR("sndio_stream_init() end, ok\n"); + (void)context; +@@ -346,7 +365,11 @@ sndio_stream_set_volume(cubeb_stream *s, float volume) + { + DPR("sndio_stream_set_volume(%f)\n", volume); + pthread_mutex_lock(&s->mtx); +- sio_setvol(s->hdl, SIO_MAXVOL * volume); ++ if (volume < 0.) ++ volume = 0.; ++ else if (volume > 1.0) ++ volume = 1.; ++ s->volume = volume; + pthread_mutex_unlock(&s->mtx); + return CUBEB_OK; + }