fecdec: Defer decoding until the next group after the first _usable_ fec group starts.
[paraslash.git] / fecdec_filter.c
index 41db249e4ff46ab1eaa829b1e5cf73ea58998f58..18dcb34d4801bb24d70472ca66c80ef08af8e73f 100644 (file)
@@ -394,6 +394,10 @@ static int dispatch_slice(char *buf, size_t len, struct fec_header *h,
                return 1;
        if (group_complete(fg)) {
                if (pfd->completion_status == GCS_NO_COMPLETE_GROUP) {
+                       enum fec_group_usability u = group_is_usable(fg, pfd);
+                       assert(u != FEC_GROUP_USABLE_SKIP_HEADER);
+                       if (u == FEC_GROUP_UNUSABLE)
+                               return 1;
                        pfd->completion_status = GCS_FIRST_GROUP_COMPLETE;
                        pfd->first_complete_group = fg;
                        return 1;