From 0a2bbc528b7865b08139155e0316738a717c4e42 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 17 Nov 2004 00:05:25 +0000 Subject: * some commenting work * add new field "read_only" to memory blocks * add new API function pa_context_get_server() * filter capture data through mcalign on client * make module-tunnel use pa_socket_client_new_string() instead of using pa_resolve_server() directly. * remove pa_resolve_server() * remove debug.h and replace it by a macro definition on the gcc command line * some strbuf cleanups * small fixes in pa_stream for cleanup when server dies * new CLI command "load-sample-dir-lazy" * send FQDN as part of server info * rework mcalign, this time with memory block merging * fix iochannel cleanup when connection dies * check getaddrinfo() results git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@286 fefdeb5f-60dc-0310-8127-8f9354f1896f --- polyp/polyplib-stream.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'polyp/polyplib-stream.c') diff --git a/polyp/polyplib-stream.c b/polyp/polyplib-stream.c index a97096b4..7d3d3a76 100644 --- a/polyp/polyplib-stream.c +++ b/polyp/polyplib-stream.c @@ -61,6 +61,8 @@ struct pa_stream *pa_stream_new(struct pa_context *c, const char *name, const st s->state = PA_STREAM_DISCONNECTED; memset(&s->buffer_attr, 0, sizeof(s->buffer_attr)); + s->mcalign = pa_mcalign_new(pa_frame_size(ss), c->memblock_stat); + s->counter = 0; s->previous_time = 0; @@ -83,6 +85,8 @@ static void stream_free(struct pa_stream *s) { assert(s->mainloop); s->mainloop->time_free(s->ipol_event); } + + pa_mcalign_free(s->mcalign); pa_xfree(s->name); pa_xfree(s); @@ -203,11 +207,13 @@ static void ipol_callback(struct pa_mainloop_api *m, struct pa_time_event *e, co struct pa_stream *s = userdata; pa_stream_ref(s); - pa_operation_unref(pa_stream_get_latency_info(s, NULL, NULL)); + if (s->state == PA_STREAM_READY) + pa_operation_unref(pa_stream_get_latency_info(s, NULL, NULL)); + gettimeofday(&tv2, NULL); tv2.tv_usec += LATENCY_IPOL_INTERVAL_USEC; - + m->time_restart(e, &tv2); pa_stream_unref(s); @@ -329,7 +335,7 @@ void pa_stream_write(struct pa_stream *s, const void *data, size_t length, void assert(s && s->context && data && length && s->state == PA_STREAM_READY && s->ref >= 1); if (free_cb) { - chunk.memblock = pa_memblock_new_user((void*) data, length, free_cb, s->context->memblock_stat); + chunk.memblock = pa_memblock_new_user((void*) data, length, free_cb, 1, s->context->memblock_stat); assert(chunk.memblock && chunk.memblock->data); } else { chunk.memblock = pa_memblock_new(length, s->context->memblock_stat); -- cgit