From 1a5060720d67fa6e4d4cb3b08c5067ec5216b0fd Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 15 Jun 2004 00:29:01 +0000 Subject: oss output works git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@15 fefdeb5f-60dc-0310-8127-8f9354f1896f --- src/sink.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/sink.c') diff --git a/src/sink.c b/src/sink.c index dfe1bcb9..f2d5373d 100644 --- a/src/sink.c +++ b/src/sink.c @@ -33,8 +33,8 @@ struct sink* sink_new(struct core *core, const char *name, const struct sample_s s->volume = 0xFF; - s->notify_callback = NULL; - s->userdata = NULL; + s->notify = NULL; + s->notify_userdata = NULL; return s; } @@ -103,6 +103,10 @@ static int do_mix(void *p, uint32_t index, int *del, void*userdata) { assert(chunk.length && chunk.length <= info->chunk->memblock->length - info->chunk->index); add_clip(info->chunk, &chunk, info->spec); + memblock_unref(chunk.memblock); + memblockq_drop(i->memblockq, info->chunk->length); + + input_stream_notify(i); return 0; } @@ -139,6 +143,8 @@ int sink_render_into(struct sink*s, struct memblock *target, struct memchunk *re target->length = l; memblock_unref(chunk.memblock); memblockq_drop(i->memblockq, l); + + input_stream_notify(i); result->memblock = target; result->length = l; @@ -191,6 +197,8 @@ int sink_render(struct sink*s, size_t length, struct memchunk *result) { l = length < result->length ? length : result->length; result->length = l; memblockq_drop(i->memblockq, l); + input_stream_notify(i); + return 0; } @@ -211,15 +219,15 @@ int sink_render(struct sink*s, size_t length, struct memchunk *result) { void sink_notify(struct sink*s) { assert(s); - if (s->notify_callback) - s->notify_callback(s, s->userdata); + if (s->notify) + s->notify(s, s->notify_userdata); } void sink_set_notify_callback(struct sink *s, void (*notify_callback)(struct sink*sink, void *userdata), void *userdata) { assert(s && notify_callback); - s->notify_callback = notify_callback; - s->userdata = userdata; + s->notify = notify_callback; + s->notify_userdata = userdata; } -- cgit