summaryrefslogtreecommitdiff
path: root/libavcodec/libxavs2.c
diff options
context:
space:
mode:
authorhwren <hwrenx@126.com>2020-07-27 14:21:35 +0800
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-28 21:57:50 +0200
commit5f8555d156c96d6aa3d42762923311a73b4d469c (patch)
tree4fa453b2511e24808613cf2c30047c91d62b4916 /libavcodec/libxavs2.c
parent466c14d10728cd315c60e602ffe3797e7dd0c3d3 (diff)
lavc/libxavs2.c: mark key-frame packets
Signed-off-by: hwren <hwrenx@126.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/libxavs2.c')
-rw-r--r--libavcodec/libxavs2.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/libxavs2.c b/libavcodec/libxavs2.c
index 76b57e731e..8519f6925a 100644
--- a/libavcodec/libxavs2.c
+++ b/libavcodec/libxavs2.c
@@ -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;