diff options
author | Anton Kindestam <antonki@kth.se> | 2019-09-12 21:00:50 +0200 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2019-09-18 23:59:32 +0300 |
commit | e08f235578aa6305a41e7c7132225e58bd191ef0 (patch) | |
tree | 5a96a85f873f1dc0e117d2fb3fb0191e6e44c462 /video/out/opengl/context_drm_egl.c | |
parent | b04ddcdc0b24c8d594bcb001c964035aa7ebd008 (diff) | |
download | mpv-e08f235578aa6305a41e7c7132225e58bd191ef0.tar.bz2 mpv-e08f235578aa6305a41e7c7132225e58bd191ef0.tar.xz |
drm: fix libmpv ABI breakage introduced in 351c083487050c88adb0e3d60f2174850f869018
Extending the client-allocated mpv_opengl_drm_params struct
constituted a break of ABI that could cause UB.
Create a clean break by deprecating "drm_params" and related structs
and enum values, and replacing it with "drm_params_v2".
Also fix some comments and code that wrongly assumed that open could
return any other negative number than -1 for failure.
This commit updates the libmpv version to 1.104
Diffstat (limited to 'video/out/opengl/context_drm_egl.c')
-rw-r--r-- | video/out/opengl/context_drm_egl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/video/out/opengl/context_drm_egl.c b/video/out/opengl/context_drm_egl.c index c4cc28b762..f06494b799 100644 --- a/video/out/opengl/context_drm_egl.c +++ b/video/out/opengl/context_drm_egl.c @@ -101,7 +101,7 @@ struct priv { struct vsync_tuple vsync; struct vo_vsync_info vsync_info; - struct mpv_opengl_drm_params drm_params; + struct mpv_opengl_drm_params_v2 drm_params; struct mpv_opengl_drm_draw_surface_size draw_surface_size; }; @@ -851,7 +851,7 @@ static bool drm_egl_init(struct ra_ctx *ctx) if (rendernode_path) { MP_VERBOSE(ctx, "Opening render node \"%s\"\n", rendernode_path); p->drm_params.render_fd = open(rendernode_path, O_RDWR | O_CLOEXEC); - if (p->drm_params.render_fd < 0) { + if (p->drm_params.render_fd == -1) { MP_WARN(ctx, "Cannot open render node \"%s\": %s. VAAPI hwdec will be disabled\n", rendernode_path, mp_strerror(errno)); } @@ -868,7 +868,7 @@ static bool drm_egl_init(struct ra_ctx *ctx) if (!ra_gl_ctx_init(ctx, &p->gl, params)) return false; - ra_add_native_resource(ctx->ra, "drm_params", &p->drm_params); + ra_add_native_resource(ctx->ra, "drm_params_v2", &p->drm_params); ra_add_native_resource(ctx->ra, "drm_draw_surface_size", &p->draw_surface_size); p->vsync_info.vsync_duration = 0; |