summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Ying <yingted@gmail.com>2017-06-01 18:00:20 -0400
committerTanu Kaskinen <tanuk@iki.fi>2017-07-20 16:50:08 +0300
commitb0cd94233af840e13609c420366de0ee8898515b (patch)
tree3b3304ed5b416eee01527b498b13b0778016e6ae
parente7d7b29c174f0b97d8a06de6fa3b555e64cc267a (diff)
downloadpulseaudio-b0cd94233af840e13609c420366de0ee8898515b.tar.gz
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
-rw-r--r--src/pulse/simple.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pulse/simple.c b/src/pulse/simple.c
index 614f4f764..c8e89b09b 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)