summaryrefslogtreecommitdiffstats
path: root/libhb/hb.c
diff options
context:
space:
mode:
authorScott <[email protected]>2017-01-15 14:25:55 +0000
committerGitHub <[email protected]>2017-01-15 14:25:55 +0000
commitc72b80dcb7cb063b40c43a47761ba2919ef85c46 (patch)
tree35058affc3a5c7bc2eedf7506eede32db5dd2f9b /libhb/hb.c
parent7545b0a6c242815fc31da306ff93d156bdee7ef4 (diff)
opencl: Workaround broken drivers that crash when you call clGetPlatformIDs with valid inputs. #496
Diffstat (limited to 'libhb/hb.c')
-rw-r--r--libhb/hb.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/libhb/hb.c b/libhb/hb.c
index 500af764e..562f0dc70 100644
--- a/libhb/hb.c
+++ b/libhb/hb.c
@@ -65,6 +65,8 @@ struct hb_handle_s
// power management opaque pointer
void * system_sleep_opaque;
+
+ int enable_opencl;
};
hb_work_object_t * hb_objects = NULL;
@@ -141,6 +143,11 @@ int hb_avcodec_open(AVCodecContext *avctx, AVCodec *codec,
return ret;
}
+int hb_get_opencl_enabled(hb_handle_t *h)
+{
+ return h->enable_opencl;
+}
+
int hb_avcodec_close(AVCodecContext *avctx)
{
int ret;
@@ -409,10 +416,17 @@ void hb_log_level_set(hb_handle_t *h, int level)
global_verbosity_level = level;
}
+/*
+ * Enable or disable support for OpenCL detection.
+ */
+void hb_opencl_set_enable(hb_handle_t *h, int enable_opencl)
+{
+ h->enable_opencl = enable_opencl;
+}
+
/**
* libhb initialization routine.
* @param verbose HB_DEBUG_NONE or HB_DEBUG_ALL.
- * @param update_check signals libhb to check for updated version from HandBrake website.
* @return Handle to hb_handle_t for use on all subsequent calls to libhb.
*/
hb_handle_t * hb_init( int verbose )
@@ -629,7 +643,10 @@ void hb_scan( hb_handle_t * h, const char * path, int title_index,
hb_log(" - logical processor count: %d", hb_get_cpu_count());
/* Print OpenCL info here so that it's in all scan and encode logs */
- hb_opencl_info_print();
+ if (hb_get_opencl_enabled(h))
+ {
+ hb_opencl_info_print();
+ }
#ifdef USE_QSV
/* Print QSV info here so that it's in all scan and encode logs */