summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-07-10 15:23:13 +0200
committerwm4 <wm4@nowhere>2017-07-10 15:32:09 +0200
commit02468dcbde8081fc79ba7b7832fe37cb3b52bb16 (patch)
treec48ea3bab843646e44ce4f3f26f455d94de157cc
parentba921e26171df3a59adbb8b945aac1a529be3a17 (diff)
downloadmpv-02468dcbde8081fc79ba7b7832fe37cb3b52bb16.tar.bz2
mpv-02468dcbde8081fc79ba7b7832fe37cb3b52bb16.tar.xz
vo_opengl: hwdec_dxva2egl: probe whether ANGLE mapping works
With some newer ANGLE builds, mapping can fail with "Failed to create EGL surface" during playback. The reason is unknown, and it might just be an ANGLE bug. Probe whether it works at init time to avoid the problem.
-rw-r--r--video/out/opengl/hwdec_dxva2egl.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/video/out/opengl/hwdec_dxva2egl.c b/video/out/opengl/hwdec_dxva2egl.c
index 65cb90eba3..c52d7a2166 100644
--- a/video/out/opengl/hwdec_dxva2egl.c
+++ b/video/out/opengl/hwdec_dxva2egl.c
@@ -91,6 +91,8 @@ static void destroy(struct gl_hwdec *hw)
IDirect3D9Ex_Release(p->d3d9ex);
}
+static int reinit(struct gl_hwdec *hw, struct mp_image_params *params);
+
static int create(struct gl_hwdec *hw)
{
if (!angle_load())
@@ -207,6 +209,16 @@ static int create(struct gl_hwdec *hw)
goto fail;
}
+
+ struct mp_image_params dummy_params = {
+ .imgfmt = IMGFMT_DXVA2,
+ .w = 256,
+ .h = 256,
+ };
+ if (reinit(hw, &dummy_params) < 0)
+ goto fail;
+ destroy_textures(hw);
+
p->hwctx = (struct mp_hwdec_ctx){
.type = HWDEC_DXVA2,
.driver_name = hw->driver->name,