summaryrefslogtreecommitdiff
path: root/polyp/pstream.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2004-08-17 19:37:29 +0000
committerLennart Poettering <lennart@poettering.net>2004-08-17 19:37:29 +0000
commite75b65715b2fc9a3363bd4ac598fe02888b7ed21 (patch)
tree4143a433981356e6a784ecf0a0c0bfc3806348ea /polyp/pstream.c
parent81822a751929fbc153282de3af447b9430d5c474 (diff)
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
Diffstat (limited to 'polyp/pstream.c')
-rw-r--r--polyp/pstream.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/polyp/pstream.c b/polyp/pstream.c
index 2d147e03a..5664e18a1 100644
--- a/polyp/pstream.c
+++ b/polyp/pstream.c
@@ -91,6 +91,8 @@ struct pa_pstream {
void (*drain_callback)(struct pa_pstream *p, void *userdata);
void *drain_userdata;
+
+ struct pa_memblock_stat *memblock_stat;
};
static void do_write(struct pa_pstream *p);
@@ -129,7 +131,7 @@ static void defer_callback(struct pa_mainloop_api *m, struct pa_defer_event *e,
do_something(p);
}
-struct pa_pstream *pa_pstream_new(struct pa_mainloop_api *m, struct pa_iochannel *io) {
+struct pa_pstream *pa_pstream_new(struct pa_mainloop_api *m, struct pa_iochannel *io, struct pa_memblock_stat *s) {
struct pa_pstream *p;
assert(io);
@@ -165,6 +167,8 @@ struct pa_pstream *pa_pstream_new(struct pa_mainloop_api *m, struct pa_iochannel
p->drain_callback = NULL;
p->drain_userdata = NULL;
+ p->memblock_stat = s;
+
return p;
}
@@ -350,7 +354,7 @@ static void do_read(struct pa_pstream *p) {
p->read.data = p->read.packet->data;
} else {
/* Frame is a memblock frame */
- p->read.memblock = pa_memblock_new(ntohl(p->read.descriptor[PA_PSTREAM_DESCRIPTOR_LENGTH]));
+ p->read.memblock = pa_memblock_new(ntohl(p->read.descriptor[PA_PSTREAM_DESCRIPTOR_LENGTH]), p->memblock_stat);
assert(p->read.memblock);
p->read.data = p->read.memblock->data;
}