]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/h263_parser.c
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavcodec / h263_parser.c
index c289ca3cc5dfb338023c266d1ab1814d2b71f2f0..a3d24ea433a79be6d56c414fd2c9176dbeb2bb4d 100644 (file)
  */
 
 /**
- * @file h263_parser.c
+ * @file
  * H.263 parser
  */
 
 #include "parser.h"
+#include "h263_parser.h"
 
 int ff_h263_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size){
     int vop_found, i;
@@ -69,20 +70,24 @@ static int h263_parse(AVCodecParserContext *s,
     ParseContext *pc = s->priv_data;
     int next;
 
-    next= ff_h263_find_frame_end(pc, buf, buf_size);
+    if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
+        next = buf_size;
+    } else {
+        next= ff_h263_find_frame_end(pc, buf, buf_size);
 
-    if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
-        *poutbuf = NULL;
-        *poutbuf_size = 0;
-        return buf_size;
+        if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
+            *poutbuf = NULL;
+            *poutbuf_size = 0;
+            return buf_size;
+        }
     }
 
-    *poutbuf = (uint8_t *)buf;
+    *poutbuf = buf;
     *poutbuf_size = buf_size;
     return next;
 }
 
-AVCodecParser h263_parser = {
+AVCodecParser ff_h263_parser = {
     { CODEC_ID_H263 },
     sizeof(ParseContext),
     NULL,