]> code.delx.au - pulseaudio/blobdiff - polyp/module-pipe-sink.c
Make the whole stuff LGPL only
[pulseaudio] / polyp / module-pipe-sink.c
index 7c779f7d537ff76b0cddc2e9a502c362522e5b98..6c441cc8c0e7d3b4d3b7da92db9405522ef33c89 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.
@@ -40,6 +40,7 @@
 #include "modargs.h"
 #include "xmalloc.h"
 #include "log.h"
+#include "module-pipe-sink-symdef.h"
 
 PA_MODULE_AUTHOR("Lennart Poettering")
 PA_MODULE_DESCRIPTION("UNIX pipe sink")
@@ -110,6 +111,13 @@ static void notify_cb(struct pa_sink*s) {
         u->core->mainloop->defer_enable(u->defer_event, 1);
 }
 
+static pa_usec_t get_latency_cb(struct pa_sink *s) {
+    struct userdata *u = s->userdata;
+    assert(s && u);
+
+    return u->memchunk.memblock ? pa_bytes_to_usec(u->memchunk.length, &s->sample_spec) : 0;
+}
+
 static void defer_callback(struct pa_mainloop_api *m, struct pa_defer_event*e, void *userdata) {
     struct userdata *u = userdata;
     assert(u);
@@ -172,6 +180,7 @@ int pa__init(struct pa_core *c, struct pa_module*m) {
         goto fail;
     }
     u->sink->notify = notify_cb;
+    u->sink->get_latency = get_latency_cb;
     u->sink->userdata = u;
     pa_sink_set_owner(u->sink, m);
     u->sink->description = pa_sprintf_malloc("Unix FIFO sink '%s'", p);