summaryrefslogtreecommitdiffstats
path: root/src/outputstream.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2004-06-14 20:30:50 +0000
committerLennart Poettering <lennart@poettering.net>2004-06-14 20:30:50 +0000
commit5ce204829fe6706a5edaec50769abf7eed266656 (patch)
treeda0930ee55ce9e99ecd8be799395221e112d2e3b /src/outputstream.c
parentc8cf0c1ce9cf1b38b302ae4a2a6fa798fef85f08 (diff)
more cleanups
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@11 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/outputstream.c')
-rw-r--r--src/outputstream.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/outputstream.c b/src/outputstream.c
index ffec77da..c6681d29 100644
--- a/src/outputstream.c
+++ b/src/outputstream.c
@@ -14,6 +14,8 @@ struct output_stream* output_stream_new(struct source *s, struct sample_spec *sp
o->name = name ? strdup(name) : NULL;
o->source = s;
o->spec = *spec;
+ o->kill = NULL;
+ o->kill_userdata = NULL;
o->memblockq = memblockq_new(bytes_per_second(spec)*5, sample_size(spec));
assert(o->memblockq);
@@ -39,3 +41,17 @@ void output_stream_free(struct output_stream* o) {
free(o->name);
free(o);
}
+
+void output_stream_set_kill_callback(struct output_stream *i, void (*kill)(struct output_stream*i, void *userdata), void *userdata) {
+ assert(i && kill);
+ i->kill = kill;
+ i->kill_userdata = userdata;
+}
+
+
+void output_stream_kill(struct output_stream*i) {
+ assert(i);
+
+ if (i->kill)
+ i->kill(i, i->kill_userdata);
+}