OSDN Git Service

h264_parser: Fix behaviour when PARSER_FLAG_COMPLETE_FRAMES is set.
authorPhilip Langdale <philipl@overt.org>
Tue, 29 Mar 2011 04:42:02 +0000 (21:42 -0700)
committerAnton Khirnov <anton@khirnov.net>
Mon, 13 Jun 2011 18:51:42 +0000 (20:51 +0200)
Currently, the parser is buggy and only processes the stream extradata
when the flag is set. This fixes it to actually inspect the frames.

Whitespce will be fixed in a separate change.

Signed-off-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavcodec/h264_parser.c

index 621ff02..a314953 100644 (file)
@@ -270,6 +270,7 @@ static int h264_parse(AVCodecParserContext *s,
             assert(pc->last_index + next >= 0 );
             ff_h264_find_frame_end(h, &pc->buffer[pc->last_index + next], -next); //update state
         }
+    }
 
         parse_nal_units(s, avctx, buf, buf_size);
 
@@ -285,7 +286,6 @@ static int h264_parse(AVCodecParserContext *s,
         if (s->flags & PARSER_FLAG_ONCE) {
             s->flags &= PARSER_FLAG_COMPLETE_FRAMES;
         }
-    }
 
     *poutbuf = buf;
     *poutbuf_size = buf_size;