diff mbox series

[FFmpeg-devel,2/2] avcodec/hevc_parser: handle PARSER_FLAG_ONCE

Message ID 20200715065057.548738-2-dima.buzdyk@gmail.com
State Superseded
Headers show
Series [FFmpeg-devel,1/2] avdevice/v4l2: add support for HEVC payloads | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Dmitry Buzdyk July 15, 2020, 6:50 a.m. UTC
* 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(-)
diff mbox series

Patch

diff --git a/libavcodec/hevc_parser.c b/libavcodec/hevc_parser.c
index 5af4b788d5..d0c9aa6e44 100644
--- a/libavcodec/hevc_parser.c
+++ b/libavcodec/hevc_parser.c
@@ -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;
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index e91e7f1d33..044921b2e4 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -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 */