]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/h263_parser.c
Merge remote branch 'qatar/master'
[ffmpeg] / libavcodec / h263_parser.c
index 7031ad901946318a8004eb0cf00f289da2da7941..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;
@@ -63,26 +64,30 @@ int ff_h263_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size){
 
 static int h263_parse(AVCodecParserContext *s,
                            AVCodecContext *avctx,
-                           uint8_t **poutbuf, int *poutbuf_size,
+                           const uint8_t **poutbuf, int *poutbuf_size,
                            const uint8_t *buf, int buf_size)
 {
     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, (uint8_t **)&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,