PARA_NOTICE_LOG("wav header not found\n");
cwt->state = CWS_NO_HEADER;
sprintf(t->status, "check wav: no header");
PARA_NOTICE_LOG("wav header not found\n");
cwt->state = CWS_NO_HEADER;
sprintf(t->status, "check wav: no header");
}
PARA_INFO_LOG("found wav header\n");
cwt->state = CWS_HAVE_HEADER;
sprintf(t->status, "check wav: have header");
cwt->channels = (unsigned) a[22];
cwt->samplerate = a[24] + (a[25] << 8) + (a[26] << 16) + (a[27] << 24);
}
PARA_INFO_LOG("found wav header\n");
cwt->state = CWS_HAVE_HEADER;
sprintf(t->status, "check wav: have header");
cwt->channels = (unsigned) a[22];
cwt->samplerate = a[24] + (a[25] << 8) + (a[26] << 16) + (a[27] << 24);
PARA_INFO_LOG("channels: %d, sample rate: %d\n", cwt->channels, cwt->samplerate);
btr_consume(cwt->btrn, WAV_HEADER_LEN);
out:
PARA_INFO_LOG("channels: %d, sample rate: %d\n", cwt->channels, cwt->samplerate);
btr_consume(cwt->btrn, WAV_HEADER_LEN);
out:
sit.btrn = btr_new_node("stdin", NULL /* stdin has no parent */, NULL, NULL);
stdin_set_defaults(&sit);
register_task(&sit.task);
sit.btrn = btr_new_node("stdin", NULL /* stdin has no parent */, NULL, NULL);
stdin_set_defaults(&sit);
register_task(&sit.task);
- wns = para_malloc(sizeof(*wns));
- wns[0] = setup_writer_node(NULL, cwt->btrn);
- if (!wns[0])
+ wns = para_calloc(sizeof(*wns));
+ ret = setup_writer_node(NULL, cwt->btrn, wns);
+ if (ret < 0)
- PARA_CRIT_LOG("i: %d\n", i);
- wns[i] = setup_writer_node(conf.writer_arg[i],
- cwt->btrn);
- if (!wns[i])
+ ret = setup_writer_node(conf.writer_arg[i],
+ cwt->btrn, wns + i);
+ if (ret < 0)