]> code.delx.au - pulseaudio/blobdiff - polyp/polyplib-simple.c
Make the whole stuff LGPL only
[pulseaudio] / polyp / polyplib-simple.c
index aa6c88f5a5384b85f04c55b605d9f1b86677f51e..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.
@@ -156,9 +156,9 @@ struct pa_simple* pa_simple_new(
         goto fail;
 
     if (dir == PA_STREAM_PLAYBACK)
-        pa_stream_connect_playback(p->stream, dev, attr, volume);
+        pa_stream_connect_playback(p->stream, dev, attr, 0, volume);
     else
-        pa_stream_connect_record(p->stream, dev, attr);
+        pa_stream_connect_record(p->stream, dev, attr, 0);
 
     /* Wait until the stream is ready */
     while (pa_stream_get_state(p->stream) != PA_STREAM_READY) {
@@ -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) {