]> git.tue.mpg.de Git - paraslash.git/commitdiff
Simplify prepare_filter_node().
authorAndre Noll <maan@systemlinux.org>
Sun, 3 Jan 2010 02:27:40 +0000 (03:27 +0100)
committerAndre Noll <maan@systemlinux.org>
Sun, 3 Jan 2010 02:27:40 +0000 (03:27 +0100)
aacdec_filter.c
filter.h
filter_common.c
mp3dec_filter.c
oggdec_filter.c
wmadec_filter.c

index b9149ef24960cf9c536afd23dada91d6dbe62658..80e49a0e0ed0661ffab921448cb9ea8b9fd5236e 100644 (file)
@@ -236,7 +236,7 @@ static void aacdec_post_select(__a_unused struct sched *s, struct task *t)
 
 next_buffer:
        t->error = 0;
-       ret = prepare_filter_node(btrn, fn->min_iqs);
+       ret = prepare_filter_node(fn);
        if (ret < 0)
                goto err;
        if (ret == 0)
index 8ef0f27f4d83bcb1cf18035d113d753fb0c0d777..8b5e8bc9ec8453cabc2833b88e9a14443c33d474 100644 (file)
--- a/filter.h
+++ b/filter.h
@@ -205,7 +205,7 @@ void filter_init(void);
 int check_filter_arg(char *filter_arg, void **conf);
 void filter_post_select(__a_unused struct sched *s, struct task *t);
 void print_filter_helps(int detailed);
-int prepare_filter_node(struct btr_node *btrn, size_t min_len);
+int prepare_filter_node(struct filter_node *fn);
 
 static inline void write_int16_host_endian(char *buf, int val)
 {
index 7ffc50a760fca12b91db898dab9da625d3532a2c..988c357631e38159f1a1a3118c91005d0ca5aca1 100644 (file)
@@ -279,8 +279,9 @@ void print_filter_helps(int detailed)
 /** 640K ought to be enough for everybody ;) */
 #define FILTER_MAX_PENDING (640 * 1024)
 
-int prepare_filter_node(struct btr_node *btrn, size_t min_len)
+int prepare_filter_node(struct filter_node *fn)
 {
+       struct btr_node *btrn = fn->btrn;
        size_t iqs;
 
        if (btr_eof(btrn))
@@ -288,10 +289,10 @@ int prepare_filter_node(struct btr_node *btrn, size_t min_len)
        if (btr_bytes_pending(btrn) > FILTER_MAX_PENDING)
                return 0;
        iqs = btr_get_input_queue_size(btrn);
-       if (iqs < min_len && !btr_no_parent(btrn))
+       if (iqs < fn->min_iqs && !btr_no_parent(btrn))
                return 0;
        assert(iqs != 0);
        /* avoid "buffer too small" errors from the decoder */
-       btr_merge(btrn, min_len);
+       btr_merge(btrn, fn->min_iqs);
        return 1;
 }
index c3f21f126ad7911a67e82903bb0ac12cdb49c13e..7fe8562df09fecebf91a4648aadfa1a73a01c403 100644 (file)
@@ -215,7 +215,7 @@ next_buffer:
        iqs = btr_get_input_queue_size(btrn);
        if (need_bad_data_delay(pmd, iqs))
                return;
-       ret = prepare_filter_node(btrn, fn->min_iqs);
+       ret = prepare_filter_node(fn);
        if (ret < 0)
                goto err;
        if (ret == 0)
index 274d0c2a141222dbb2022d97c9d9fbb047173528..1347244285ff05552548c37829dd445344ebd7a2 100644 (file)
@@ -207,7 +207,7 @@ static void ogg_post_select(__a_unused struct sched *s, struct task *t)
        char *in;
 
        t->error = 0;
-       ret = prepare_filter_node(btrn, fn->min_iqs);
+       ret = prepare_filter_node(fn);
        if (ret < 0)
                goto err;
        if (ret == 0)
index 87de6b44aef35bd78c42bd469b2a36c167750d06..803ef59f6402e9727d342b74d2fbc1a3c6b19e7d 100644 (file)
@@ -1254,7 +1254,7 @@ static void wmadec_post_select(__a_unused struct sched *s, struct task *t)
 
 next_buffer:
        t->error = 0;
-       ret = prepare_filter_node(btrn, fn->min_iqs);
+       ret = prepare_filter_node(fn);
        if (ret < 0)
                goto err;
        if (ret == 0)