summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
Diffstat (limited to 'video/out')
-rw-r--r--video/out/vo_opengl.c9
1 files changed, 6 insertions, 3 deletions
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;