fecdec.c: Don't warn about incomplete slices at close time.
authorAndre Noll <maan@systemlinux.org>
Sun, 1 Mar 2009 13:42:39 +0000 (14:42 +0100)
committerAndre Noll <maan@systemlinux.org>
Sun, 1 Mar 2009 13:42:39 +0000 (14:42 +0100)
Move that warning to free_oldest_group().

fecdec_filter.c

index 6b6716a..8b326de 100644 (file)
@@ -92,10 +92,6 @@ static void clear_group(struct fecdec_group *fg)
 {
        int i;
 
-       if (!group_complete(fg) && !group_empty(fg))
-               PARA_WARNING_LOG("Clearing incomplete group %d "
-                       "(contains %d slices)\n", fg->h.group_num,
-                       fg->num_received_slices);
        for (i = 0; i < fg->num_slices; i++) {
                free(fg->data[i]);
                fg->data[i] = NULL;
@@ -155,6 +151,10 @@ static struct fecdec_group *free_oldest_group(struct private_fecdec_data *pfd)
                if (!oldest || oldest->h.group_num > fg->h.group_num)
                        oldest = fg;
        }
+       if (!group_complete(oldest) && !group_empty(oldest))
+               PARA_WARNING_LOG("Clearing incomplete group %d "
+                       "(contains %d slices)\n", fg->h.group_num,
+                       fg->num_received_slices);
        clear_group(oldest);
        return oldest;
 }