]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - compress_filter.c
audiod: Don't open the receiver too early.
[paraslash.git] / compress_filter.c
index 14df8d966128556e32957749b91bdd225730b1c1..39055618cde7ea16bfd5f2207f4b00a3b314c5e2 100644 (file)
@@ -110,6 +110,10 @@ next_buffer:
                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