-/*
- * Copyright (C) 2006 Andre Noll <maan@tuebingen.mpg.de>
- *
- * Licensed under the GPL v2. For licencing details see COPYING.
- */
+/* Copyright (C) 2006 Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */
/** \file grab_client.c Functions for grabbing the audio stream. */
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);
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.
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);
}
/*
* 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;
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;
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)