X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=compress_filter.c;h=39055618cde7ea16bfd5f2207f4b00a3b314c5e2;hp=7c392746c5c1e02bc03408876e8af65f1a8118da;hb=c282c836791cedf57c128555af90af37c7c01c05;hpb=aa234b7afe223879a7bd7274ce05a3a315a2ec49 diff --git a/compress_filter.c b/compress_filter.c index 7c392746..39055618 100644 --- a/compress_filter.c +++ b/compress_filter.c @@ -103,13 +103,17 @@ static void compress_post_select(__a_unused struct sched *s, struct task *t) //inplace = false; next_buffer: t->error = 0; - ret = btr_node_status(btrn, fn->min_iqs); + ret = btr_node_status(btrn, fn->min_iqs, BTR_NT_INTERNAL); if (ret < 0) goto err; if (ret == 0) return; btr_merge(btrn, fn->min_iqs); length = btr_next_buffer(btrn, &inbuf) & ~(size_t)1; + if (length == 0) { /* eof and 1 byte available */ + ret = -E_COMPRESS_EOF; + goto err; + } ip = (int16_t *)inbuf; if (inplace) op = ip; @@ -184,6 +188,11 @@ static void open_compress(struct filter_node *fn) pcd->max_gain = 1 << (pcd->conf->inertia_arg + pcd->conf->aggressiveness_arg); } +static void compress_free_config(void *conf) +{ + compress_cmdline_parser_free(conf); +} + /** * The init function of the compress filter. * @@ -200,6 +209,7 @@ void compress_filter_init(struct filter *f) f->pre_select = generic_filter_pre_select; f->post_select = compress_post_select; f->parse_config = compress_parse_config; + f->free_config = compress_free_config; f->help = (struct ggo_help) { .short_help = compress_filter_args_info_help, .detailed_help = compress_filter_args_info_detailed_help