[FFmpeg-devel] [PATCH v2 1/6] avcodec/evc: Set the AV_FRAME_FLAG_KEY flag for a decoded frame when the decoded packet contains a keyframe

Dawid Kozinski d.kozinski at samsung.com
Thu Apr 18 11:43:06 EEST 2024


Signed-off-by: Dawid Kozinski <d.kozinski at samsung.com>
---
 libavcodec/libxevd.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/libxevd.c b/libavcodec/libxevd.c
index c6c7327e65..e864bd5200 100644
--- a/libavcodec/libxevd.c
+++ b/libavcodec/libxevd.c
@@ -391,6 +391,11 @@ static int libxevd_receive_frame(AVCodecContext *avctx, AVFrame *frame)
             if (stat.read != nalu_size)
                 av_log(avctx, AV_LOG_INFO, "Different reading of bitstream (in:%d, read:%d)\n,", nalu_size, stat.read);
 
+            if (stat.stype == XEVD_ST_I) { 
+                frame->pict_type = AV_PICTURE_TYPE_I;
+                frame->flags |= AV_FRAME_FLAG_KEY;
+            }
+
             // stat.fnum - has negative value if the decoded data is not frame
             if (stat.fnum >= 0) {
 
-- 
2.25.1



More information about the ffmpeg-devel mailing list