Message ID | 20240524052058.1671400-2-haihao.xiang@intel.com |
---|---|
State | Accepted |
Commit | c872ba5899eb520bac313e063336c007852499ea |
Headers | show |
Series | [FFmpeg-devel,1/2] lavc/qsvdec: fix keyframes | expand |
Context | Check | Description |
---|---|---|
yinshiyou/make_loongarch64 | success | Make finished |
yinshiyou/make_fate_loongarch64 | success | Make fate finished |
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index 3df355ce78..8200a14012 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -2482,7 +2482,7 @@ static int encode_frame(AVCodecContext *avctx, QSVEncContext *q, if (frame->pict_type == AV_PICTURE_TYPE_I) { enc_ctrl->FrameType = MFX_FRAMETYPE_I | MFX_FRAMETYPE_REF; - if (q->forced_idr) + if ((frame->flags & AV_FRAME_FLAG_KEY) || q->forced_idr) enc_ctrl->FrameType |= MFX_FRAMETYPE_IDR; } }