lavc/libxavs2.c: mark key-frame packets

Signed-off-by: hwren <hwrenx@126.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
hwren 2020-07-27 14:21:35 +08:00 committed by Michael Niedermayer
parent 466c14d107
commit 5f8555d156

View 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;