]> granicus.if.org Git - handbrake/commitdiff
json: Decoding JSON now checks if QSV is available before setting QSV… (#509)
authorScott <sr55@users.noreply.github.com>
Wed, 11 Jan 2017 19:34:19 +0000 (19:34 +0000)
committerGitHub <noreply@github.com>
Wed, 11 Jan 2017 19:34:19 +0000 (19:34 +0000)
json: Decoding JSON now checks if QSV is available before setting QSV… #509

libhb/hb_json.c

index 5321d31a1f1490dc794c9a62ad1a43b02f103ca5..296cd9d2492acd9046daf28e272c4006ad77f934 100644 (file)
@@ -11,6 +11,7 @@
 #include "hb.h"
 #include "hb_json.h"
 #include "libavutil/base64.h"
+#include "qsv_common.h"
 
 /**
  * Convert an hb_state_t to a jansson dict
@@ -918,6 +919,9 @@ hb_job_t* hb_dict_to_job( hb_handle_t * h, hb_dict_t *dict )
         hb_error("hb_dict_to_job: failed to parse dict: %s", error.text);
         goto fail;
     }
+    
+    // Make sure QSV Decode is only True if the hardware is available.
+    job->qsv.decode = job->qsv.decode && hb_qsv_available(); 
 
     // Lookup mux id
     if (hb_value_type(mux) == HB_VALUE_TYPE_STRING)