+static void oss_post_select(__a_unused struct sched *s,
+ struct task *t)
+{
+ struct writer_node *wn = container_of(t, struct writer_node, task);
+ struct private_oss_write_data *powd = wn->private_data;
+ struct btr_node *btrn = wn->btrn;
+ size_t frames, bytes;
+ int ret = btr_node_status(btrn, wn->min_iqs, BTR_NT_LEAF);
+ char *data;
+
+ if (ret < 0)
+ goto out;
+ if (ret == 0)
+ return;
+ if (!powd) {
+ int32_t rate, ch, format;
+ get_btr_sample_rate(btrn, &rate);
+ get_btr_channels(btrn, &ch);
+ get_btr_sample_format(btrn, &format);
+ ret = oss_init(wn, rate, ch, format);
+ if (ret < 0)
+ goto out;
+ return;
+ }
+ btr_merge(btrn, wn->min_iqs);
+ bytes = btr_next_buffer(btrn, &data);
+ frames = bytes / powd->bytes_per_frame;
+ if (!frames) { /* eof and less than a single frame available */
+ ret = -E_WRITE_COMMON_EOF;
+ goto out;
+ }
+ ret = 0;
+ if (!FD_ISSET(powd->fd, &s->wfds))
+ goto out;
+ ret = xwrite(powd->fd, data, frames * powd->bytes_per_frame);
+ if (ret < 0)
+ goto out;
+ btr_consume(btrn, ret);
+ ret = 0;
+out:
+ t->error = ret;
+ if (ret < 0)
+ btr_remove_node(btrn);
+}
+
+__malloc static void *oss_parse_config_or_die(const char *options)