X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=prebuffer_filter.c;h=548a8177a544d183c9cd49bc2ae2bc81f8ea7db2;hp=a83eacc9d7e53f627985f6cfdfc86eccb588fa47;hb=9b565c60fd159e12d255bb18db9dbff066deebea;hpb=12a302780e2ed2933f1be628832f3a9e3a0c02ee diff --git a/prebuffer_filter.c b/prebuffer_filter.c index a83eacc9..548a8177 100644 --- a/prebuffer_filter.c +++ b/prebuffer_filter.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Andre Noll + * Copyright (C) 2009-2010 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -49,19 +49,13 @@ static void prebuffer_pre_select(struct sched *s, struct task *t) tv_add(&tv, now, &ppd->barrier); } if (tv_diff(&ppd->barrier, now, &diff) < 0) - goto min_delay; - if (tv_diff(&diff, &s->timeout, NULL) < 0) - s->timeout = diff; - return; -min_delay: - s->timeout.tv_sec = 0; - s->timeout.tv_usec = 1; + return sched_min_delay(s); + sched_request_timeout(&diff, s); } static void prebuffer_close(struct filter_node *fn) { free(fn->private_data); - free(fn->buf); } static void prebuffer_post_select(__a_unused struct sched *s, struct task *t) @@ -80,7 +74,6 @@ static void prebuffer_post_select(__a_unused struct sched *s, struct task *t) if (iqs < conf->size_arg) return; btr_splice_out_node(btrn); - prebuffer_close(fn); t->error = -E_PREBUFFER_SUCCESS; } @@ -112,8 +105,6 @@ static void prebuffer_open(struct filter_node *fn) ppd->conf = fn->conf; fn->private_data = ppd; - fn->bufsize = 8192; /* gets increased on demand */ - fn->buf = para_malloc(fn->bufsize); } static void prebuffer_free_config(void *conf)