www/firefox-esr: improve A/V sync with SNDIO=on

PR:		215867
Reported by:	Sergey <kpect@protonmail.com>
Submitted by:	Tobias Kortkamp <t@tobik.me>
Obtained from:	upstream
MFH:		2017Q1
This commit is contained in:
Jan Beich 2017-01-13 17:59:03 +00:00
parent 27bace6c0d
commit 5ed2ce4ef5
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=431408
9 changed files with 162 additions and 3 deletions

View file

@ -3,7 +3,7 @@
PORTNAME= thunderbird
DISTVERSION= 45.6.0
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= mail news net-im ipv6
MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \
MOZILLA/${PORTNAME}/candidates/${DISTVERSION}-candidates/build1/source

View file

@ -0,0 +1,13 @@
Bug 1153151 - make libcubeb sndio use non-blocking i/o
--- mozilla/media/libcubeb/src/cubeb_sndio.c.orig 2017-01-12 17:53:15 UTC
+++ mozilla/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");

View file

@ -0,0 +1,40 @@
Bug 1153179 - fix latency reporting in libcubeb sndio
--- mozilla/media/libcubeb/src/cubeb_sndio.c.orig 2017-01-12 17:53:15 UTC
+++ mozilla/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;
}

View file

@ -4,7 +4,7 @@
PORTNAME= firefox
DISTVERSION= 45.6.0
DISTVERSIONSUFFIX=esr.source
PORTREVISION= 4
PORTREVISION= 5
PORTEPOCH= 1
CATEGORIES= www ipv6
MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}esr/source \

View file

@ -0,0 +1,13 @@
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");

View file

@ -0,0 +1,40 @@
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;
}

View file

@ -3,7 +3,7 @@
PORTNAME= libxul
DISTVERSION= 45.6.0
PORTREVISION= 4
PORTREVISION= 5
CATEGORIES?= www devel
MASTER_SITES= MOZILLA/firefox/releases/${DISTVERSION}esr/source \
MOZILLA/firefox/candidates/${DISTVERSION}esr-candidates/build1/source

View file

@ -0,0 +1,13 @@
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");

View file

@ -0,0 +1,40 @@
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;
}