Add btr support to the oggdec filter.
[paraslash.git] / oss_write.c
index 552d5b9705821df8d25720b29f8069629dcb0ade..bda0ad4cb7189fec9311c1cdfb9896e3fe9b7598 100644 (file)
@@ -6,10 +6,12 @@
 
 /** \file oss_write.c Paraslash's oss output plugin. */
 
+#include <regex.h>
 #include <sys/ioctl.h>
 #include <fcntl.h>
 #include <dirent.h>
 #include <sys/soundcard.h>
+#include <stdbool.h>
 
 #include "para.h"
 #include "fd.h"
@@ -17,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"
@@ -47,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;
@@ -216,4 +219,5 @@ void oss_write_init(struct writer *w)
                .short_help = oss_write_args_info_help,
                .detailed_help = oss_write_args_info_detailed_help
        };
+       oss_cmdline_parser_free(&dummy);
 }