From 02468dcbde8081fc79ba7b7832fe37cb3b52bb16 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 10 Jul 2017 15:23:13 +0200 Subject: 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. --- video/out/opengl/hwdec_dxva2egl.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'video') 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, -- cgit v1.2.3