From 12a302780e2ed2933f1be628832f3a9e3a0c02ee Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Tue, 12 Jan 2010 06:25:52 +0100 Subject: [PATCH] Prebuffer: Kill non-btr code. --- prebuffer_filter.c | 47 ---------------------------------------------- 1 file changed, 47 deletions(-) diff --git a/prebuffer_filter.c b/prebuffer_filter.c index 207d3324..a83eacc9 100644 --- a/prebuffer_filter.c +++ b/prebuffer_filter.c @@ -29,52 +29,6 @@ struct private_prebuffer_data { struct timeval barrier; }; -static ssize_t prebuffer_convert(char *inbuf, size_t inbuf_len, - struct filter_node *fn) -{ - struct private_prebuffer_data *ppd = fn->private_data; - struct prebuffer_filter_args_info *conf = ppd->conf; - - if (inbuf_len == 0) { - if (*fn->fc->input_error < 0 && ppd->prebuffered >= 0) - goto prebuffer_end; - return 0; - } - if (ppd->prebuffered < 0) { - size_t copy = PARA_MIN(inbuf_len, fn->bufsize - fn->loaded); - memcpy(fn->buf + fn->loaded, inbuf, copy); - fn->loaded += copy; - return copy; - } - if (ppd->prebuffered + inbuf_len > fn->bufsize) { - fn->bufsize = PARA_MAX(2 * fn->bufsize, - ppd->prebuffered + inbuf_len); - fn->buf = para_realloc(fn->buf, fn->bufsize); - } - memcpy(fn->buf + ppd->prebuffered, inbuf, inbuf_len); - if (ppd->prebuffered == 0) { - struct timeval tv; - PARA_INFO_LOG("prebuffer period %dms\n", - conf->duration_arg); - ms2tv(conf->duration_arg, &tv); - tv_add(&tv, now, &ppd->barrier); - } - ppd->prebuffered += inbuf_len; - PARA_DEBUG_LOG("%d bytes prebuffered\n", ppd->prebuffered); - if (*fn->fc->input_error >= 0) { - struct timeval diff; - if (tv_diff(now, &ppd->barrier, &diff) < 0) - goto out; - if (ppd->prebuffered < conf->size_arg) - goto out; - } -prebuffer_end: - fn->loaded = ppd->prebuffered; - ppd->prebuffered = -1; -out: - return inbuf_len; -} - static void prebuffer_pre_select(struct sched *s, struct task *t) { struct filter_node *fn = container_of(t, struct filter_node, task); @@ -179,7 +133,6 @@ void prebuffer_filter_init(struct filter *f) prebuffer_cmdline_parser_init(&dummy); f->open = prebuffer_open; f->close = prebuffer_close; - f->convert = prebuffer_convert; f->parse_config = prebuffer_parse_config; f->free_config = prebuffer_free_config; f->pre_select = prebuffer_pre_select; -- 2.39.5