]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Simplify dispatch_slice().
authorAndre Noll <maan@systemlinux.org>
Sun, 1 Mar 2009 21:10:53 +0000 (22:10 +0100)
committerAndre Noll <maan@systemlinux.org>
Sun, 1 Mar 2009 21:10:53 +0000 (22:10 +0100)
fecdec_filter.c

index 6ca0b037da0f55be826137facc4632415648329c..376fe6b3cc66ab5965b05b1d479a7ba7b34fe0ed 100644 (file)
@@ -198,6 +198,8 @@ static int add_slice(char *buf, struct fecdec_group *fg)
        int r, slice_num;
 
        if (group_complete(fg)) {
+               PARA_DEBUG_LOG("group complete, ignoring slice %d\n",
+                       fg->h.slice_num);
                fg->num_received_slices++;
                return 0;
        }
@@ -285,14 +287,8 @@ static int dispatch_slice(char *buf, size_t len, struct fec_header *h,
        ret = get_group(h, pfd, &fg);
        if (ret < 0)
                return ret;
-       if (group_complete(fg)) {
-               PARA_DEBUG_LOG("group complete, ignoring slice %d\n",
-                       h->slice_num);
+       if (!add_slice(buf, fg))
                return 1;
-       }
-       ret = add_slice(buf, fg);
-       if (ret < 0)
-               return ret;
        if (group_complete(fg)) {
                if (!pfd->fec) {
                        int k = h->data_slices_per_group, n = h->slices_per_group;