Add btr support to the oggdec filter.
[paraslash.git] / oss_write.c
index 9ec85560d29ebef00f269a95ca2fda49e9c427d1..bda0ad4cb7189fec9311c1cdfb9896e3fe9b7598 100644 (file)
@@ -11,6 +11,7 @@
 #include <fcntl.h>
 #include <dirent.h>
 #include <sys/soundcard.h>
+#include <stdbool.h>
 
 #include "para.h"
 #include "fd.h"
@@ -18,6 +19,7 @@
 #include "list.h"
 #include "sched.h"
 #include "ggo.h"
+#include "buffer_tree.h"
 #include "write.h"
 #include "oss_write.cmdline.h"
 #include "error.h"
@@ -48,13 +50,13 @@ static int oss_pre_select(struct sched *s, struct writer_node *wn)
        struct private_oss_write_data *powd = wn->private_data;
        struct writer_node_group *wng = wn->wng;
 
-       if (!*wng->loaded)
+       if (*wng->loaded - wn->written < powd->bytes_per_frame)
                return 0;
        para_fd_set(powd->fd, &s->wfds, &s->max_fileno);
        return 1;
 }
-static int oss_post_select(__a_unused struct sched *s,
-               struct writer_node *wn)
+
+static int oss_post_select(struct sched *s, struct writer_node *wn)
 {
        int ret;
        struct private_oss_write_data *powd = wn->private_data;