From: Andre Noll Date: Thu, 5 Nov 2009 21:21:38 +0000 (+0100) Subject: oss_pre_select(): Fix check for empty infput buffer. X-Git-Tag: v0.4.0~5^2~2 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=37c49eac5be8587bcbf2257553e28d2ee8628e14;p=paraslash.git oss_pre_select(): Fix check for empty infput buffer. We must take into account the number of bytes already written, and we can not write less than a single frame. --- diff --git a/oss_write.c b/oss_write.c index 6a55005e..d8b571b6 100644 --- a/oss_write.c +++ b/oss_write.c @@ -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;