summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-11-09 11:57:11 +0100
committerwm4 <wm4@nowhere>2015-11-09 11:57:11 +0100
commit76e50f6a3d52a75bbee3b32b4f57a0e038cb4909 (patch)
tree525ae8ec3a411a0fa35022d4e5d169f9ba8efda8
parent7d5282ea5d4d351d259e73b0051e7bd3e1658b53 (diff)
downloadmpv-76e50f6a3d52a75bbee3b32b4f57a0e038cb4909.tar.bz2
mpv-76e50f6a3d52a75bbee3b32b4f57a0e038cb4909.tar.xz
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.
-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;