X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=grab_client.c;h=8370649301906eaef68a4c30d1b1f3975283dea8;hp=11fff4cc985db6716d14ee663f59facf764a2eeb;hb=HEAD;hpb=8d106ca317a2c42f35a86ba244f843688f6939e6 diff --git a/grab_client.c b/grab_client.c index 11fff4cc..1019e579 100644 --- a/grab_client.c +++ b/grab_client.c @@ -1,14 +1,9 @@ -/* - * Copyright (C) 2006 Andre Noll - * - * Licensed under the GPL v2. For licencing details see COPYING. - */ +/* Copyright (C) 2006 Andre Noll , see file COPYING. */ /** \file grab_client.c Functions for grabbing the audio stream. */ #include #include -#include #include #include "audiod_cmd.lsg.h" @@ -94,7 +89,7 @@ err: return -E_GC_WRITE; } -static void gc_pre_select(struct sched *s, void *context) +static void gc_pre_monitor(struct sched *s, void *context) { struct grab_client *gc = context; int ret = btr_node_status(gc->btrn, 0, BTR_NT_LEAF); @@ -103,14 +98,14 @@ static void gc_pre_select(struct sched *s, void *context) return; if (ret < 0) sched_min_delay(s); - para_fd_set(gc->fd, &s->wfds, &s->max_fileno); + sched_monitor_writefd(gc->fd, s); } /* - * We need this forward declaration as post_select() needs + * We need this forward declaration as gc_post_monitor() needs * activate_grab_client and vice versa. */ -static int gc_post_select(struct sched *s, void *context); +static int gc_post_monitor(struct sched *s, void *context); /** * Move a grab client to the active list and start it. @@ -134,8 +129,8 @@ static void gc_activate(struct grab_client *gc, struct sched *s) gc->task = task_register(&(struct task_info) { .name = name, - .pre_select = gc_pre_select, - .post_select = gc_post_select, + .pre_monitor = gc_pre_monitor, + .post_monitor = gc_post_monitor, .context = gc, }, s); } @@ -176,7 +171,7 @@ static int gc_close(struct grab_client *gc, int err) /* * We must not free the gc structure here as it contains ->task * which is still used because this function is called from - * post_select(). + * post_monitor(). */ close(gc->fd); gc->fd = -1; @@ -187,7 +182,7 @@ static int gc_close(struct grab_client *gc, int err) return 0; } -static int gc_post_select(__a_unused struct sched *s, void *context) +static int gc_post_monitor(__a_unused struct sched *s, void *context) { struct grab_client *gc = context; struct btr_node *btrn = gc->btrn; @@ -266,7 +261,7 @@ static int gc_check_args(struct lls_parse_result *lpr, struct grab_client *gc) int grab_client_new(int fd, struct lls_parse_result *lpr, struct sched *s) { int ret; - struct grab_client *gc = para_calloc(sizeof(struct grab_client)); + struct grab_client *gc = zalloc(sizeof(struct grab_client)); ret = gc_check_args(lpr, gc); if (ret < 0)