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.
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.
connection_free((struct connection *) o->userdata);
}
+static pa_usec_t source_output_get_latency_cb(struct pa_source_output *o) {
+ struct connection*c = o->userdata;
+ assert(o && c);
+ return pa_bytes_to_usec(pa_memblockq_get_length(c->output_memblockq), &c->source_output->sample_spec);
+}
+
/*** client callbacks ***/
static void client_kill_cb(struct pa_client *c) {
goto fail;
}
- if (!(c->sink_input = pa_sink_input_new(sink, c->client->name, &p->sample_spec, 0))) {
+ if (!(c->sink_input = pa_sink_input_new(sink, c->client->name, &p->sample_spec, 0, -1))) {
pa_log(__FILE__": Failed to create sink input.\n");
goto fail;
}
goto fail;
}
- c->source_output = pa_source_output_new(source, c->client->name, &p->sample_spec);
+ c->source_output = pa_source_output_new(source, c->client->name, &p->sample_spec, -1);
if (!c->source_output) {
pa_log(__FILE__": Failed to create source output.\n");
goto fail;
c->source_output->push = source_output_push_cb;
c->source_output->kill = source_output_kill_cb;
+ c->source_output->get_latency = source_output_get_latency_cb;
c->source_output->userdata = c;
l = (size_t) (pa_bytes_per_second(&p->sample_spec)*RECORD_BUFFER_SECONDS);