- PARA_INFO_LOG("%s\n", PARA_STRERROR(-t->ret));
- unregister_task(t);
- if (t->ret == -E_WAV_HEADER_SUCCESS) {
- conf.channels_arg = cwt.channels;
- conf.sample_rate_arg = cwt.sample_rate;
- }
- idt.task.pre_select = initial_delay_pre_select;
- idt.task.private_data = &idt;
- idt.task.event_handler = idt_event_handler;
- sprintf(idt.task.status, "initial_delay");
- register_task(&idt.task);
-}
-
-int main(int argc, char *argv[])
-{
- int ret = -E_WRITE_SYNTAX;
- struct sched s;
-
- cmdline_parser(argc, argv, &conf);
- wng = check_args();
- if (!wng)
- goto out;
- init_supported_writers();
- init_sched();
-
- stdin_set_defaults(&sit);
- sit.buf = para_malloc(sit.bufsize),
- register_task(&sit.task);
-
- cwt.task.pre_select = check_wav_pre_select;
- cwt.task.private_data = &cwt;
- cwt.task.event_handler = cwt_event_handler;
- cwt.buf = sit.buf;
- cwt.loaded = &sit.loaded;
- cwt.eof = &sit.eof;
- sprintf(cwt.task.status, "check wav");
- register_task(&cwt.task);
-
- s.default_timeout.tv_sec = 1;
- s.default_timeout.tv_usec = 0;
- ret = sched(&s);
-
-out:
- if (ret < 0) {
- PARA_ERROR_LOG("%s\n", PARA_STRERROR(-ret));
- ret = EXIT_FAILURE;
- } else
- ret = EXIT_SUCCESS;
- return ret;