From 9c9fe68e8cf86514230993825559c61cadeae22a Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 18 Nov 2009 19:23:45 +0100 Subject: [PATCH] fecdec: Defer decoding until the next group after the first _usable_ fec group starts. Commit faeabd31b4bea5c097acff4738a0626e3c84f1d9 (fecdec: Defer decoding until the first slice of the second group arrives.) changed the fec decoder such that it does not start to write the decoded output ASAP but waits until the next group starts. This is generally a good idea, but the patch missed the fact that the first complete group might be unusable in case of streams that carry an audio file header (currently only ogg vorbis). Fix this flaw by setting the completion status to GCS_FIRST_GROUP_COMPLETE only if we received a complete group that is also usable. --- fecdec_filter.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fecdec_filter.c b/fecdec_filter.c index 41db249e..18dcb34d 100644 --- a/fecdec_filter.c +++ b/fecdec_filter.c @@ -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; -- 2.30.2