Browse Source

lavc/libxavs2.c: mark key-frame packets

Signed-off-by: hwren <hwrenx@126.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.4
hwren Michael Niedermayer 5 years ago
parent
commit
5f8555d156
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      libavcodec/libxavs2.c

+ 6
- 0
libavcodec/libxavs2.c 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;



Loading…
Cancel
Save