From: Andre Noll Date: Sun, 1 Mar 2009 21:10:53 +0000 (+0100) Subject: Simplify dispatch_slice(). X-Git-Tag: v0.3.4~57^2~1 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=7434497d38b31cc9b40e7fdd62b17d1bf25099bc;ds=sidebyside Simplify dispatch_slice(). --- diff --git a/fecdec_filter.c b/fecdec_filter.c index 6ca0b037..376fe6b3 100644 --- a/fecdec_filter.c +++ b/fecdec_filter.c @@ -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;