FreeBSD Bugzilla – Attachment 194791 Details for
Bug 229135
www/firefox: Backport sndio volume handling fix
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
thunderbird-sndio.diff
thunderbird-sndio.diff (text/plain), 2.84 KB, created by
Tobias Kortkamp
on 2018-06-30 13:51:17 UTC
(
hide
)
Description:
thunderbird-sndio.diff
Filename:
MIME Type:
Creator:
Tobias Kortkamp
Created:
2018-06-30 13:51:17 UTC
Size:
2.84 KB
patch
obsolete
>Index: Makefile >=================================================================== >--- Makefile (revision 473595) >+++ Makefile (working copy) >@@ -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 >Index: files/patch-bug1467882 >=================================================================== >--- files/patch-bug1467882 (nonexistent) >+++ files/patch-bug1467882 (working copy) >@@ -0,0 +1,70 @@ >+--- mozilla/media/libcubeb/src/cubeb_sndio.c.orig 2018-05-16 23:58:58.000000000 +0200 >++++ 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; >+ } > >Property changes on: files/patch-bug1467882 >___________________________________________________________________ >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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
jbeich
:
maintainer-approval+
Actions:
View
|
Diff
Attachments on
bug 229135
:
194384
|
194790
| 194791