]> git.sesse.net Git - ffmpeg/commitdiff
lavc/libxavs2.c: mark key-frame packets
authorhwren <hwrenx@126.com>
Mon, 27 Jul 2020 06:21:35 +0000 (14:21 +0800)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 28 Jul 2020 19:57:50 +0000 (21:57 +0200)
Signed-off-by: hwren <hwrenx@126.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/libxavs2.c

index 76b57e731e84c6df5744bc1260399a908db15bab..8519f6925a3fc9e004818308c2e3bb5f38b437ae 100644 (file)
@@ -223,6 +223,12 @@ static int xavs2_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
         pkt->pts = cae->packet.pts;
         pkt->dts = cae->packet.dts;
 
+        if (cae->packet.type == XAVS2_TYPE_IDR ||
+            cae->packet.type == XAVS2_TYPE_I ||
+            cae->packet.type == XAVS2_TYPE_KEYFRAME) {
+            pkt->flags |= AV_PKT_FLAG_KEY;
+        }
+
         memcpy(pkt->data, cae->packet.stream, cae->packet.len);
         pkt->size = cae->packet.len;