lavc/qsvenc: add error messeage if ICQ unsupported.
authorLi, Zhong <zhong.li@intel.com>
Thu, 7 Dec 2017 06:44:27 +0000 (14:44 +0800)
committerMaxym Dmytrychenko <maxim.d33@gmail.com>
Tue, 12 Dec 2017 12:58:18 +0000 (13:58 +0100)
Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
libavcodec/qsvenc.c

index f6034c4..5eacf3c 100644 (file)
@@ -295,6 +295,12 @@ static int select_rc_mode(AVCodecContext *avctx, QSVEncContext *q)
         return AVERROR(EINVAL);
     }
 
+    if (!want_qscale && avctx->global_quality > 0 && !QSV_HAVE_ICQ){
+        av_log(avctx, AV_LOG_ERROR,
+               "ICQ ratecontrol mode requested, but is not supported by this SDK version\n");
+        return AVERROR(ENOSYS);
+    }
+
     if (want_qscale) {
         rc_mode = MFX_RATECONTROL_CQP;
         rc_desc = "constant quantization parameter (CQP)";