]> code.delx.au - pulseaudio/blobdiff - polyp/polyplib-simple.c
Make the whole stuff LGPL only
[pulseaudio] / polyp / polyplib-simple.c
index 9e111e2a12cd32bf990b61c7116af76dbecb5ebf..a73aacfae1358cf58f1be0ad8d86c70577c8f61f 100644 (file)
@@ -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) {