diff options
author | Zhong Li <zhong.li@intel.com> | 2018-12-12 10:44:18 +0300 |
---|---|---|
committer | Zhong Li <zhong.li@intel.com> | 2019-01-10 16:48:27 +0300 |
commit | 0aaaca25e044a4b87fb8f899f3a920b79163e811 (patch) | |
tree | d2dd3a4e48596205c34bd7a7fb5f635f8cf37e3a /libavcodec/qsvenc.c | |
parent | e92ce340e63058de32aec733b59fe2b196bed214 (diff) |
lavc/qsvenc: set pict_type to be I for IDR frames.
Signed-off-by: Zhong Li <zhong.li@intel.com>
Diffstat (limited to 'libavcodec/qsvenc.c')
-rw-r--r-- | libavcodec/qsvenc.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index 5b6c68e307..e3b5a72dd4 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -1341,11 +1341,10 @@ int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q, new_pkt.pts = av_rescale_q(bs->TimeStamp, (AVRational){1, 90000}, avctx->time_base); new_pkt.size = bs->DataLength; - if (bs->FrameType & MFX_FRAMETYPE_IDR || - bs->FrameType & MFX_FRAMETYPE_xIDR) + if (bs->FrameType & MFX_FRAMETYPE_IDR || bs->FrameType & MFX_FRAMETYPE_xIDR) { new_pkt.flags |= AV_PKT_FLAG_KEY; - - if (bs->FrameType & MFX_FRAMETYPE_I || bs->FrameType & MFX_FRAMETYPE_xI) + pict_type = AV_PICTURE_TYPE_I; + } else if (bs->FrameType & MFX_FRAMETYPE_I || bs->FrameType & MFX_FRAMETYPE_xI) pict_type = AV_PICTURE_TYPE_I; else if (bs->FrameType & MFX_FRAMETYPE_P || bs->FrameType & MFX_FRAMETYPE_xP) pict_type = AV_PICTURE_TYPE_P; |