diff options
author | hwren <hwrenx@126.com> | 2020-07-27 14:21:35 +0800 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-07-28 21:57:50 +0200 |
commit | 5f8555d156c96d6aa3d42762923311a73b4d469c (patch) | |
tree | 4fa453b2511e24808613cf2c30047c91d62b4916 /libavcodec | |
parent | 466c14d10728cd315c60e602ffe3797e7dd0c3d3 (diff) | |
download | ffmpeg-5f8555d156c96d6aa3d42762923311a73b4d469c.tar.gz |
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')
-rw-r--r-- | libavcodec/libxavs2.c | 6 |
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; |