mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-29 15:11:09 +08:00
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.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user