Index: head/www/palemoon/Makefile =================================================================== --- head/www/palemoon/Makefile (revision 470833) +++ head/www/palemoon/Makefile (revision 470834) @@ -1,61 +1,62 @@ # Created by: Zhihao Yuan # $FreeBSD$ PORTNAME= palemoon DISTVERSION= 27.9.2 +PORTREVISION= 1 DISTVERSIONSUFFIX=_Release CATEGORIES= www ipv6 MAINTAINER= lichray@gmail.com COMMENT= Open Source Goanna-based web browser BUILD_DEPENDS= nspr>=4.15:devel/nspr \ nss>=3.31.1:security/nss \ libevent>=2.0.22:devel/libevent \ harfbuzz>=1.4.3:print/harfbuzz \ graphite2>=1.3.10:graphics/graphite2 \ png>=1.6.16:graphics/png \ libvpx>=1.5.0:multimedia/libvpx \ sqlite3>=3.19.3:databases/sqlite3 \ ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} \ autoconf-2.13:devel/autoconf213 \ yasm:devel/yasm \ zip:archivers/zip USE_GITHUB= yes GH_ACCOUNT= MoonchildProductions GH_PROJECT= Pale-Moon USE_GECKO= gecko MOZ_PKGCONFIG_FILES= # empty USE_MOZILLA= -soundtouch USE_GL= gl PM_ICON= ${PORTNAME}.png PM_ICON_SRC= ${PREFIX}/lib/${PORTNAME}/browser/icons/mozicon128.png PM_DESKTOP= ${WRKSRC}/browser/branding/official/${PORTNAME}.desktop MOZ_OPTIONS= --enable-application=browser \ --enable-devtools \ --enable-jemalloc \ --enable-jemalloc-lib OPTIONS_DEFAULT= BUNDLED_CAIRO GTK2 OPTIONS_EXCLUDE= DTRACE INTEGER_SAMPLES JACK TEST .include "${.CURDIR}/../../www/firefox/Makefile.options" post-patch: @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ ${WRKSRC}/browser/app/nsBrowserApp.cpp pre-configure: (cd ${WRKSRC} && ${LOCALBASE}/bin/autoconf-2.13) (cd ${WRKSRC}/js/src/ && ${LOCALBASE}/bin/autoconf-2.13) post-install: ${MKDIR} ${STAGEDIR}${PREFIX}/share/pixmaps ${INSTALL_DATA} ${PM_DESKTOP} ${STAGEDIR}${PREFIX}/share/applications/ ${LN} -sf ${PM_ICON_SRC} ${STAGEDIR}${PREFIX}/share/pixmaps/${PM_ICON} .include Index: head/www/palemoon/files/patch-bug1153179 =================================================================== --- head/www/palemoon/files/patch-bug1153179 (revision 470833) +++ head/www/palemoon/files/patch-bug1153179 (nonexistent) @@ -1,40 +0,0 @@ -Bug 1153179 - fix latency reporting in libcubeb sndio - ---- media/libcubeb/src/cubeb_sndio.c.orig 2017-01-12 17:53:15 UTC -+++ media/libcubeb/src/cubeb_sndio.c -@@ -67,7 +67,7 @@ sndio_onmove(void *arg, int delta) - { - cubeb_stream *s = (cubeb_stream *)arg; - -- s->rdpos += delta; -+ s->rdpos += delta * s->bpf; - } - - static void * -@@ -135,7 +135,7 @@ sndio_mainloop(void *arg) - state = CUBEB_STATE_ERROR; - break; - } -- s->wrpos = 0; -+ s->wrpos += n; - start += n; - } - } -@@ -326,7 +336,7 @@ sndio_stream_get_position(cubeb_stream * - { - pthread_mutex_lock(&s->mtx); - DPR("sndio_stream_get_position() %lld\n", s->rdpos); -- *p = s->rdpos; -+ *p = s->rdpos / s->bpf; - pthread_mutex_unlock(&s->mtx); - return CUBEB_OK; - } -@@ -346,7 +356,7 @@ sndio_stream_get_latency(cubeb_stream * - { - // http://www.openbsd.org/cgi-bin/man.cgi?query=sio_open - // in the "Measuring the latency and buffers usage" paragraph. -- *latency = stm->wrpos - stm->rdpos; -+ *latency = (stm->wrpos - stm->rdpos) / stm->bpf; - return CUBEB_OK; - } - Property changes on: head/www/palemoon/files/patch-bug1153179 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/www/palemoon/files/patch-cubeb5ffce9e91b =================================================================== --- head/www/palemoon/files/patch-cubeb5ffce9e91b (revision 470833) +++ head/www/palemoon/files/patch-cubeb5ffce9e91b (nonexistent) @@ -1,41 +0,0 @@ -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 Property changes on: head/www/palemoon/files/patch-cubeb5ffce9e91b ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/www/palemoon/files/patch-bug1153151 =================================================================== --- head/www/palemoon/files/patch-bug1153151 (revision 470833) +++ head/www/palemoon/files/patch-bug1153151 (nonexistent) @@ -1,13 +0,0 @@ -Bug 1153151 - make libcubeb sndio use non-blocking i/o - ---- media/libcubeb/src/cubeb_sndio.c.orig 2017-01-12 17:53:15 UTC -+++ media/libcubeb/src/cubeb_sndio.c -@@ -187,7 +187,7 @@ sndio_stream_init(cubeb *context, - if (s == NULL) - return CUBEB_ERROR; - s->context = context; -- s->hdl = sio_open(NULL, SIO_PLAY, 0); -+ s->hdl = sio_open(NULL, SIO_PLAY, 1); - if (s->hdl == NULL) { - free(s); - DPR("sndio_stream_init(), sio_open() failed\n"); Property changes on: head/www/palemoon/files/patch-bug1153151 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/www/palemoon/files/patch-sndio =================================================================== --- head/www/palemoon/files/patch-sndio (nonexistent) +++ head/www/palemoon/files/patch-sndio (revision 470834) @@ -0,0 +1,145 @@ +Bug 1153151 - make libcubeb sndio use non-blocking i/o +Bug 1153179 - fix latency reporting in libcubeb sndio + +From cubeb: +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. + +https://marc.info/?l=openbsd-ports&m=152641946326955&w=2 +Apply volume in software as do other backends. This is necessary +because sndio volume may be controlled externally and there's no +volume getter in libcubeb to notify the caller about volume +changes. + +--- media/libcubeb/src/cubeb_sndio.c.orig 2018-05-24 13:59:58 UTC ++++ 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 +@@ -41,17 +42,39 @@ struct cubeb_stream { + uint64_t wrpos; /* number of written frames */ + cubeb_data_callback data_cb; /* cb to preapare data */ + cubeb_state_callback state_cb; /* cb to notify about state changes */ ++ float volume; /* current volume */ + void *arg; /* user arg to {data,state}_cb */ + }; + + 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) +- *(dst++) = *(src++) * 32767; ++ while (nsamp-- > 0) { ++ s = lrintf(*(src++) * mult); ++ if (s < -32768) ++ s = -32768; ++ else if (s > 32767) ++ s = 32767; ++ *(dst++) = s; ++ } + } + + static void +@@ -59,7 +82,7 @@ sndio_onmove(void *arg, int delta) + { + cubeb_stream *s = (cubeb_stream *)arg; + +- s->rdpos += delta; ++ s->rdpos += delta * s->bpf; + } + + static void * +@@ -103,7 +126,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; + } +@@ -127,7 +152,7 @@ sndio_mainloop(void *arg) + state = CUBEB_STATE_ERROR; + break; + } +- s->wrpos = 0; ++ s->wrpos += n; + start += n; + } + } +@@ -179,7 +204,7 @@ sndio_stream_init(cubeb *context, + if (s == NULL) + return CUBEB_ERROR; + s->context = context; +- s->hdl = sio_open(NULL, SIO_PLAY, 0); ++ s->hdl = sio_open(NULL, SIO_PLAY, 1); + if (s->hdl == NULL) { + free(s); + DPR("sndio_stream_init(), sio_open() failed\n"); +@@ -242,6 +267,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; +@@ -318,7 +344,7 @@ sndio_stream_get_position(cubeb_stream *s, uint64_t *p + { + pthread_mutex_lock(&s->mtx); + DPR("sndio_stream_get_position() %lld\n", s->rdpos); +- *p = s->rdpos; ++ *p = s->rdpos / s->bpf; + pthread_mutex_unlock(&s->mtx); + return CUBEB_OK; + } +@@ -328,7 +354,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; + } +@@ -338,7 +368,7 @@ sndio_stream_get_latency(cubeb_stream * stm, uint32_t + { + // http://www.openbsd.org/cgi-bin/man.cgi?query=sio_open + // in the "Measuring the latency and buffers usage" paragraph. +- *latency = stm->wrpos - stm->rdpos; ++ *latency = (stm->wrpos - stm->rdpos) / stm->bpf; + return CUBEB_OK; + } + Property changes on: head/www/palemoon/files/patch-sndio ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property