- int i, ret = -E_WRITE_SYNTAX;
- struct writer_node_group *g = NULL;
-
- if (conf.list_writers_given) {
- char *msg = NULL;
- FOR_EACH_WRITER(i) {
- char *tmp = make_message("%s%s%s",
- i? msg : "",
- i? " " : "",
- writer_names[i]);
- free(msg);
- msg = tmp;
- }
- fprintf(stderr, "%s\n", msg);
- free(msg);
- exit(EXIT_SUCCESS);
- }
- if (conf.start_time_given) {
- long unsigned sec, usec;
- if (sscanf(conf.start_time_arg, "%lu:%lu",
- &sec, &usec) != 2)
- goto out;
- idt.start_time.tv_sec = sec;
- idt.start_time.tv_usec = usec;
- }
- if (!conf.writer_given) {
- g = setup_default_wng();
- ret = 1;
- goto out;
- }
- g = wng_new(conf.writer_given);
- ret = -E_WRITE_SYNTAX;
- for (i = 0; i < conf.writer_given; i++) {
- int writer_num;
- g->writer_nodes[i].conf = check_writer_arg(
- conf.writer_arg[i], &writer_num);
- if (!g->writer_nodes[i].conf)
- goto out;
- g->writer_nodes[i].writer = &writers[writer_num];
- }
- ret = 1;
-out:
- if (ret > 0)
- return g;
- free(g);
- return NULL;
+ struct write_task *wt = container_of(t, struct write_task, task);
+ check_wav_pre_select(s, wt->cwc);