]> granicus.if.org Git - handbrake/commitdiff
libhb: fix OpenCL initialization.
authorTim Walker <tdskywalker@gmail.com>
Mon, 21 Sep 2015 21:37:31 +0000 (23:37 +0200)
committerTim Walker <tdskywalker@gmail.com>
Mon, 21 Sep 2015 21:37:31 +0000 (23:37 +0200)
It was borken in 293083e5

libhb/work.c

index 11c8d291928a36a2f3280e392726f492fda949d4..8ea9db918f23de2c8ff47eacad0dac213644f82e 100644 (file)
@@ -624,11 +624,14 @@ static void do_job(hb_job_t *job)
      * the library if we aren't going to use it. But we only call hb_ocl_close
      * in hb_global_close, since un/reloading the library each run is wasteful.
      */
-    if (job->use_opencl && (hb_ocl_init() || hb_init_opencl_run_env(0, NULL, "-I.")))
+    if (job->use_opencl)
     {
-        hb_log("work: failed to initialize OpenCL environment, using fallback");
-        hb_release_opencl_run_env();
-        job->use_opencl = 0;
+        if (hb_ocl_init() || hb_init_opencl_run_env(0, NULL, "-I."))
+        {
+            hb_log("work: failed to initialize OpenCL environment, using fallback");
+            hb_release_opencl_run_env();
+            job->use_opencl = 0;
+        }
     }
     else
     {