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 6ca0b03..376fe6b 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;