oss_pre_select(): Fix check for empty infput buffer.
authorAndre Noll <maan@systemlinux.org>
Thu, 5 Nov 2009 21:21:38 +0000 (22:21 +0100)
committerAndre Noll <maan@systemlinux.org>
Thu, 5 Nov 2009 21:21:38 +0000 (22:21 +0100)
We must take into account the number of bytes already written, and we can not write less
than a single frame.

oss_write.c

index 6a55005..d8b571b 100644 (file)
@@ -47,7 +47,7 @@ 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;