]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mjpeg_parser.c
AAC: Add a global header but output not locked output configuration status.
[ffmpeg] / libavcodec / mjpeg_parser.c
index 6bbf999dd4f2af96c9546b0608d0e893f91a8faa..ce824a68713af3a12a18376693ab8d141ceb7909 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 /**
- * @file mjpeg_parser.c
+ * @file libavcodec/mjpeg_parser.c
  * MJPEG parser.
  */
 
@@ -71,19 +71,23 @@ static int find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size){
 }
 
 static int jpeg_parse(AVCodecParserContext *s,
-                           AVCodecContext *avctx,
-                           const uint8_t **poutbuf, int *poutbuf_size,
-                           const uint8_t *buf, int buf_size)
+                      AVCodecContext *avctx,
+                      const uint8_t **poutbuf, int *poutbuf_size,
+                      const uint8_t *buf, int buf_size)
 {
     ParseContext *pc = s->priv_data;
     int next;
 
-    next= find_frame_end(pc, buf, buf_size);
+    if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){
+        next= buf_size;
+    }else{
+        next= 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 = buf;