X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=write.c;h=acfb94605b53d259a89ea41e75507b81e2cb2ca4;hb=HEAD;hp=a1907b6f46a04f966722117e894f9fe0a69edb11;hpb=764e71ceb1e188086c08e38dfd52d45b67dc15ba;p=paraslash.git diff --git a/write.c b/write.c index a1907b6f..cb32d391 100644 --- a/write.c +++ b/write.c @@ -1,8 +1,4 @@ -/* - * Copyright (C) 2005 Andre Noll - * - * Licensed under the GPL v2. For licencing details see COPYING. - */ +/* Copyright (C) 2005 Andre Noll , see file COPYING. */ /** \file write.c Paraslash's standalone wav/raw player. */ @@ -58,16 +54,16 @@ struct write_task { struct check_wav_context *cwc; }; -static void write_pre_select(struct sched *s, void *context) +static void write_pre_monitor(struct sched *s, void *context) { struct write_task *wt = context; - check_wav_pre_select(s, wt->cwc); + check_wav_pre_monitor(s, wt->cwc); } -static int write_post_select(__a_unused struct sched *s, void *context) +static int write_post_monitor(__a_unused struct sched *s, void *context) { struct write_task *wt = context; - return check_wav_post_select(wt->cwc); + return check_wav_post_monitor(wt->cwc); } static int setup_and_schedule(struct lls_parse_result *lpr) @@ -87,21 +83,20 @@ static int setup_and_schedule(struct lls_parse_result *lpr) wt.cwc = check_wav_init(sit.btrn, NULL, &wp, &cw_btrn); wt.task = task_register(&(struct task_info) { .name = "write", - .pre_select = write_pre_select, - .post_select = write_post_select, + .pre_monitor = write_pre_monitor, + .post_monitor = write_post_monitor, .context = &wt, }, &s); n = writer_given? writer_given : 1; - wns = para_calloc(n * sizeof(*wns)); + wns = arr_zalloc(n, sizeof(*wns)); for (i = 0; i < n; i++) { const char *arg = i < writer_given? lls_string_val(i, OPT_RESULT(WRITER, lpr)) : NULL; wns[i].wid = check_writer_arg_or_die(arg, &wns[i].lpr); register_writer_node(wns + i, cw_btrn, &s); } - s.default_timeout.tv_sec = 10; - s.default_timeout.tv_usec = 50000; + s.default_timeout = 10500; ret = schedule(&s); if (ret >= 0) { int j, ts; @@ -109,7 +104,7 @@ static int setup_and_schedule(struct lls_parse_result *lpr) struct writer_node *wn = wns + j; ts = task_status(wn->task); assert(ts < 0); - if (ts != -E_WRITE_COMMON_EOF && ts != -E_BTR_EOF) { + if (ts != -E_EOF) { const char *name = writer_name(wn->wid); PARA_ERROR_LOG("%s: %s\n", name, para_strerror(-ts));