[FFmpeg-devel] [PATCH] lavc/qsvenc: return error with zero output
Xiang, Haihao
haihao.xiang at intel.com
Thu Aug 10 09:37:14 EEST 2023
From: Haihao Xiang <haihao.xiang at intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang at intel.com>
---
libavcodec/qsvenc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 7ff9d333a2..b3b7475b0f 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -2584,7 +2584,7 @@ int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q,
pict_type = AV_PICTURE_TYPE_P;
else if (qpkt.bs->FrameType & MFX_FRAMETYPE_B || qpkt.bs->FrameType & MFX_FRAMETYPE_xB)
pict_type = AV_PICTURE_TYPE_B;
- else if (qpkt.bs->FrameType == MFX_FRAMETYPE_UNKNOWN) {
+ else if (qpkt.bs->FrameType == MFX_FRAMETYPE_UNKNOWN && qpkt.bs->DataLength) {
pict_type = AV_PICTURE_TYPE_NONE;
av_log(avctx, AV_LOG_WARNING, "Unknown FrameType, set pict_type to AV_PICTURE_TYPE_NONE.\n");
} else {
--
2.34.1
More information about the ffmpeg-devel
mailing list