X-Git-Url: https://code.delx.au/pulseaudio/blobdiff_plain/5bac3c3ce515cb588f3928431db4fe1c396d53e7..fa499dad06ba6558111cdef64c18f2401e803cff:/polyp/polyplib-simple.c diff --git a/polyp/polyplib-simple.c b/polyp/polyplib-simple.c index 9e111e2a..a73aacfa 100644 --- a/polyp/polyplib-simple.c +++ b/polyp/polyplib-simple.c @@ -4,7 +4,7 @@ This file is part of polypaudio. polypaudio is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published + it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. @@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License + You should have received a copy of the GNU Lesser General Public License along with polypaudio; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. @@ -325,8 +325,12 @@ static void latency_complete(struct pa_stream *s, const struct pa_latency_info * if (!l) p->dead = 1; - else - p->latency = l->buffer_usec + l->sink_usec + l->transport_usec; + else { + int negative = 0; + p->latency = pa_stream_get_latency(s, l, &negative); + if (negative) + p->latency = 0; + } } pa_usec_t pa_simple_get_playback_latency(struct pa_simple *p, int *perror) { @@ -341,7 +345,7 @@ pa_usec_t pa_simple_get_playback_latency(struct pa_simple *p, int *perror) { } p->latency = 0; - o = pa_stream_get_latency(p->stream, latency_complete, p); + o = pa_stream_get_latency_info(p->stream, latency_complete, p); while (pa_operation_get_state(o) == PA_OPERATION_RUNNING) {