From 76e50f6a3d52a75bbee3b32b4f57a0e038cb4909 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 9 Nov 2015 11:57:11 +0100 Subject: vo_opengl: always preload hwdec interop Simplifies some auto detection matters. I _still_ don't want to remove the lazy loading mechanism, because it's still slightly useful for filters using the hwdec APIs. My main motivation for not always preloading them is actually that libva prints random useless crap to the terminal with no way to prevent this. --- video/out/vo_opengl.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'video') diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c index 66ab7f11a7..ccd52cde69 100644 --- a/video/out/vo_opengl.c +++ b/video/out/vo_opengl.c @@ -37,6 +37,7 @@ #include "common/common.h" #include "misc/bstr.h" #include "common/msg.h" +#include "common/global.h" #include "options/m_config.h" #include "vo.h" #include "video/mp_image.h" @@ -439,9 +440,11 @@ static int preinit(struct vo *vo) p->hwdec_info.load_api = call_request_hwdec_api; p->hwdec_info.load_api_ctx = vo; - if (vo->opts->hwdec_preload_api != HWDEC_NONE) { - p->hwdec = - gl_hwdec_load_api_id(p->vo->log, p->gl, vo->opts->hwdec_preload_api); + int hwdec = vo->opts->hwdec_preload_api; + if (hwdec == HWDEC_NONE) + hwdec = vo->global->opts->hwdec_api; + if (hwdec != HWDEC_NONE) { + p->hwdec = gl_hwdec_load_api_id(p->vo->log, p->gl, hwdec); gl_video_set_hwdec(p->renderer, p->hwdec); if (p->hwdec) p->hwdec_info.hwctx = p->hwdec->hwctx; -- cgit v1.2.3