View | Details | Raw Unified | Return to bug 215867 | Differences between
and this patch

Collapse All | Expand All

(-)b/www/firefox-esr/files/patch-bug1153151 (+13 lines)
Added Link Here
1
Bug 1153151 - make libcubeb sndio use non-blocking i/o
2
3
--- media/libcubeb/src/cubeb_sndio.c.orig	2017-01-12 17:53:15 UTC
4
+++ media/libcubeb/src/cubeb_sndio.c
5
@@ -187,7 +187,7 @@ sndio_stream_init(cubeb *context,
6
   if (s == NULL)
7
     return CUBEB_ERROR;
8
   s->context = context;
9
-  s->hdl = sio_open(NULL, SIO_PLAY, 0);
10
+  s->hdl = sio_open(NULL, SIO_PLAY, 1);
11
   if (s->hdl == NULL) {
12
     free(s);
13
     DPR("sndio_stream_init(), sio_open() failed\n");
(-)b/www/firefox-esr/files/patch-bug1153179 (+40 lines)
Added Link Here
1
Bug 1153179 - fix latency reporting in libcubeb sndio
2
3
--- media/libcubeb/src/cubeb_sndio.c.orig	2017-01-12 17:53:15 UTC
4
+++ media/libcubeb/src/cubeb_sndio.c
5
@@ -67,7 +67,7 @@ sndio_onmove(void *arg, int delta)
6
 {
7
   cubeb_stream *s = (cubeb_stream *)arg;
8
 
9
-  s->rdpos += delta;
10
+  s->rdpos += delta * s->bpf;
11
 }
12
 
13
 static void *
14
@@ -135,7 +135,7 @@ sndio_mainloop(void *arg)
15
         state = CUBEB_STATE_ERROR;
16
         break;
17
       }
18
-      s->wrpos = 0;
19
+      s->wrpos += n;
20
       start += n;
21
     }
22
   }
23
@@ -326,7 +336,7 @@ sndio_stream_get_position(cubeb_stream *
24
 {
25
   pthread_mutex_lock(&s->mtx);
26
   DPR("sndio_stream_get_position() %lld\n", s->rdpos);
27
-  *p = s->rdpos;
28
+  *p = s->rdpos / s->bpf;
29
   pthread_mutex_unlock(&s->mtx);
30
   return CUBEB_OK;
31
 }
32
@@ -346,7 +356,7 @@ sndio_stream_get_latency(cubeb_stream * 
33
 {
34
   // http://www.openbsd.org/cgi-bin/man.cgi?query=sio_open
35
   // in the "Measuring the latency and buffers usage" paragraph.
36
-  *latency = stm->wrpos - stm->rdpos;
37
+  *latency = (stm->wrpos - stm->rdpos) / stm->bpf;
38
   return CUBEB_OK;
39
 }
40
 

Return to bug 215867