[vlc-commits] qsv: refine setup error logging

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


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Apr  4 08:40:44 2018 +0200| [0bfc4de975b51ebed5b35f01bfea62eda097be49] | committer: Steve Lhomme

qsv: refine setup error logging

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

 modules/codec/qsv.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/modules/codec/qsv.c b/modules/codec/qsv.c
index dbe3932ca7..d958c11d90 100644
--- a/modules/codec/qsv.c
+++ b/modules/codec/qsv.c
@@ -558,10 +558,16 @@ 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, &param_out) < 0 ||
-         sys->params.mfx.RateControlMethod != param_out.mfx.RateControlMethod )
+    sts = MFXVideoENCODE_Query(sys->session, &sys->params, &param_out);
+    if ( sts < MFX_ERR_NONE )
     {
-        msg_Err(enc, "Unsupported control method");
+        msg_Err(enc, "Unsupported encoding parameters (%d)", sts);
+        goto error;
+    }
+
+    if ( sys->params.mfx.RateControlMethod != param_out.mfx.RateControlMethod )
+    {
+        msg_Err(enc, "Unsupported control method %d got %d", sys->params.mfx.RateControlMethod, param_out.mfx.RateControlMethod);
         goto error;
     }
 



More information about the vlc-commits mailing list