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
This commit is contained in:
Ted Ying 2017-06-01 18:00:20 -04:00 committed by Tanu Kaskinen
parent e7d7b29c17
commit b0cd94233a

View file

@ -466,7 +466,7 @@ pa_usec_t pa_simple_get_latency(pa_simple *p, int *rerror) {
pa_usec_t extra = 0; pa_usec_t extra = 0;
if (p->direction == PA_STREAM_RECORD) 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 (negative) {
if (extra > t) if (extra > t)