@@ -331,6 +331,10 @@ static int hevc_parse(AVCodecParserContext *s, AVCodecContext *avctx,
if (!is_dummy_buf)
parse_nal_units(s, buf, buf_size, avctx);
+ if (s->flags & PARSER_FLAG_ONCE) {
+ s->flags &= PARSER_FLAG_COMPLETE_FRAMES;
+ }
+
*poutbuf = buf;
*poutbuf_size = buf_size;
return next;
@@ -786,7 +786,7 @@ enum AVStreamParseType {
AVSTREAM_PARSE_FULL, /**< full parsing and repack */
AVSTREAM_PARSE_HEADERS, /**< Only parse headers, do not repack. */
AVSTREAM_PARSE_TIMESTAMPS, /**< full parsing and interpolation of timestamps for frames not starting on a packet boundary */
- AVSTREAM_PARSE_FULL_ONCE, /**< full parsing and repack of the first frame only, only implemented for H.264 currently */
+ AVSTREAM_PARSE_FULL_ONCE, /**< full parsing and repack of the first frame only, only implemented for H.264 and HEVC currently */
AVSTREAM_PARSE_FULL_RAW, /**< full parsing and repack with timestamp and position generation by parser for raw
this assumes that each packet in the file contains no demuxer level headers and
just codec level data, otherwise position generation would fail */
* make HEVC parser respect PARSER_FLAG_ONCE flag Signed-off-by: Dima Buzdyk <dima.buzdyk@gmail.com> --- libavcodec/hevc_parser.c | 4 ++++ libavformat/avformat.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-)