- cwt->samplerate = a[24] + (a[25] << 8) + (a[26] << 16) + (a[27] << 24);
-consume:
- PARA_INFO_LOG("channels: %d, sample rate: %d\n", cwt->channels, cwt->samplerate);
- btr_consume(cwt->btrn, WAV_HEADER_LEN);
-out:
- if (sz) {
- btr_pushdown(cwt->btrn);
- s->timeout.tv_sec = 0;
- s->timeout.tv_usec = 1;
- } else {
- if (btr_no_parent(cwt->btrn))
- t->error = -E_WRITE_EOF;
- }
-err:
- if (t->error < 0)
- btr_del_node(cwt->btrn);
-}
-
-static void initial_delay_pre_select(struct sched *s, struct task *t)
-{
- struct initial_delay_task *idt = container_of(t, struct initial_delay_task, task);
- struct timeval diff;
-
- if (!idt->start_time.tv_sec && !idt->start_time.tv_usec) {
- t->error = -E_NO_DELAY;
- goto register_check_wav;
- }
- if (tv_diff(now, &idt->start_time, &diff) > 0) {
- t->error = -E_DELAY_TIMEOUT;
- goto register_check_wav;
+ cwt->sample_rate = a[24] + (a[25] << 8) + (a[26] << 16) + (a[27] << 24);
+ bps = a[34] + ((unsigned)a[35] << 8);
+ if (bps != 8 && bps != 16) {
+ PARA_WARNING_LOG("%u bps not supported, assuming 16\n", bps);
+ bps = 16;