[pulseaudio-commits] Branch 'next' - src/pulse

Tanu Kaskinen tanuk at kemper.freedesktop.org
Sat Jun 17 15:42:41 UTC 2017


 src/pulse/simple.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c71e3ac033504e7a724561c5359850b982a39f49
Author: Ted Ying <yingted at gmail.com>
Date:   Thu Jun 1 18:00:20 2017 -0400

    simple: Change latency estimation to account for already-read data in pa_simple_get_latency().
    
    BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=81075

diff --git a/src/pulse/simple.c b/src/pulse/simple.c
index 614f4f76..c8e89b09 100644
--- a/src/pulse/simple.c
+++ b/src/pulse/simple.c
@@ -466,7 +466,7 @@ pa_usec_t pa_simple_get_latency(pa_simple *p, int *rerror) {
             pa_usec_t extra = 0;
 
             if (p->direction == PA_STREAM_RECORD)
-                extra = pa_bytes_to_usec(p->read_length, pa_stream_get_sample_spec(p->stream));
+                extra = -pa_bytes_to_usec(p->read_index, pa_stream_get_sample_spec(p->stream));
 
             if (negative) {
                 if (extra > t)



More information about the pulseaudio-commits mailing list