From e75b65715b2fc9a3363bd4ac598fe02888b7ed21 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 17 Aug 2004 19:37:29 +0000 Subject: remove global memblock statistic variables in favor of memblock_stat objects git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@137 fefdeb5f-60dc-0310-8127-8f9354f1896f --- polyp/protocol-native.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'polyp/protocol-native.c') diff --git a/polyp/protocol-native.c b/polyp/protocol-native.c index e86c78f0..060b4241 100644 --- a/polyp/protocol-native.c +++ b/polyp/protocol-native.c @@ -229,7 +229,7 @@ static struct record_stream* record_stream_new(struct connection *c, struct pa_s s->source_output->owner = c->protocol->module; s->source_output->client = c->client; - s->memblockq = pa_memblockq_new(maxlength, 0, base = pa_frame_size(ss), 0, 0); + s->memblockq = pa_memblockq_new(maxlength, 0, base = pa_frame_size(ss), 0, 0, c->protocol->core->memblock_stat); assert(s->memblockq); s->fragment_size = (fragment_size/base)*base; @@ -274,7 +274,7 @@ static struct playback_stream* playback_stream_new(struct connection *c, struct s->sink_input->owner = c->protocol->module; s->sink_input->client = c->client; - s->memblockq = pa_memblockq_new(maxlength, tlength, pa_frame_size(ss), prebuf, minreq); + s->memblockq = pa_memblockq_new(maxlength, tlength, pa_frame_size(ss), prebuf, minreq, c->protocol->core->memblock_stat); assert(s->memblockq); s->requested_bytes = 0; @@ -780,8 +780,10 @@ static void command_stat(struct pa_pdispatch *pd, uint32_t command, uint32_t tag assert(reply); pa_tagstruct_putu32(reply, PA_COMMAND_REPLY); pa_tagstruct_putu32(reply, tag); - pa_tagstruct_putu32(reply, pa_memblock_get_count()); - pa_tagstruct_putu32(reply, pa_memblock_get_total()); + pa_tagstruct_putu32(reply, c->protocol->core->memblock_stat->total); + pa_tagstruct_putu32(reply, c->protocol->core->memblock_stat->total_size); + pa_tagstruct_putu32(reply, c->protocol->core->memblock_stat->allocated); + pa_tagstruct_putu32(reply, c->protocol->core->memblock_stat->allocated_size); pa_pstream_send_tagstruct(c->pstream, reply); } @@ -1313,7 +1315,7 @@ static void pstream_memblock_callback(struct pa_pstream *p, uint32_t channel, in u->length = 0; fprintf(stderr, "COPY\n"); } else { - u->memchunk.memblock = pa_memblock_new(u->length); + u->memchunk.memblock = pa_memblock_new(u->length, c->protocol->core->memblock_stat); u->memchunk.index = u->memchunk.length = 0; } } @@ -1372,7 +1374,7 @@ static void on_connection(struct pa_socket_server*s, struct pa_iochannel *io, vo c->client->userdata = c; c->client->owner = p->module; - c->pstream = pa_pstream_new(p->core->mainloop, io); + c->pstream = pa_pstream_new(p->core->mainloop, io, p->core->memblock_stat); assert(c->pstream); pa_pstream_set_recieve_packet_callback(c->pstream, pstream_packet_callback, c); -- cgit