[vlc-commits] qsv: check the encoding parameters are OK before using them

Steve Lhomme git at videolan.org
Wed Apr 4 18:28:06 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Mon Sep  4 09:07:58 2017 +0200| [4ce8737a09bbcbe57af799c2bafdb5e1dd41e5d9] | committer: Steve Lhomme

qsv: check the encoding parameters are OK before using them

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4ce8737a09bbcbe57af799c2bafdb5e1dd41e5d9
---

 modules/codec/qsv.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/codec/qsv.c b/modules/codec/qsv.c
index 6f722158a1..44b75f2386 100644
--- a/modules/codec/qsv.c
+++ b/modules/codec/qsv.c
@@ -555,6 +555,12 @@ static int Open(vlc_object_t *this)
             sys->params.mfx.MaxKbps = var_InheritInteger(enc, SOUT_CFG_PREFIX "bitrate-max");
     }
 
+    if (MFXVideoENCODE_Query(sys->session, &sys->params, &sys->params) < 0)
+    {
+        msg_Err(enc, "Error querying encoder params");
+        goto error;
+    }
+
     /* Request number of surface needed and creating frame pool */
     if (MFXVideoENCODE_QueryIOSurf(sys->session, &sys->params, &alloc_request)!= MFX_ERR_NONE)
     {



More information about the vlc-commits mailing list