diff --git a/libavcodec/mjpeg_parser.c b/libavcodec/mjpeg_parser.c index 2cf2e84588..d14aaaf742 100644 --- a/libavcodec/mjpeg_parser.c +++ b/libavcodec/mjpeg_parser.c @@ -78,6 +78,9 @@ static int jpeg_parse(AVCodecParserContext *s, ParseContext *pc = s->priv_data; int next; + 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) { @@ -85,6 +88,7 @@ static int jpeg_parse(AVCodecParserContext *s, *poutbuf_size = 0; return buf_size; } + } *poutbuf = buf; *poutbuf_size = buf_size;