summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/hwdec_vaegl.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-05-11 17:41:54 +0200
committerwm4 <wm4@nowhere>2017-05-11 17:47:33 +0200
commit2b616c0682a894152b06ef7249b32ef17037b3e5 (patch)
treed2714deb7052e11b32437d66c348fa2b2ac6562e /video/out/opengl/hwdec_vaegl.c
parentf2961425e770defe7cedc14ee2d4c9d4a53ab203 (diff)
downloadmpv-2b616c0682a894152b06ef7249b32ef17037b3e5.tar.bz2
mpv-2b616c0682a894152b06ef7249b32ef17037b3e5.tar.xz
vo_opengl: drop TLS usage
TLS is a headache. We should avoid it if we can. The involved mechanism is unfortunately entangled with the unfortunate libmpv API for returning pointers to host API objects. This has to be kept until we change the API somehow. Practically untested out of pure laziness. I'm sure I'll get a bunch of reports if it's broken.
Diffstat (limited to 'video/out/opengl/hwdec_vaegl.c')
-rw-r--r--video/out/opengl/hwdec_vaegl.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/video/out/opengl/hwdec_vaegl.c b/video/out/opengl/hwdec_vaegl.c
index dc2645bf05..548d3678f3 100644
--- a/video/out/opengl/hwdec_vaegl.c
+++ b/video/out/opengl/hwdec_vaegl.c
@@ -56,7 +56,7 @@ typedef void *EGLImageKHR;
static VADisplay *create_x11_va_display(GL *gl)
{
- Display *x11 = gl->MPGetNativeDisplay("x11");
+ Display *x11 = mpgl_get_native_display(gl, "x11");
return x11 ? vaGetDisplay(x11) : NULL;
}
#endif
@@ -66,7 +66,7 @@ static VADisplay *create_x11_va_display(GL *gl)
static VADisplay *create_wayland_va_display(GL *gl)
{
- struct wl_display *wl = gl->MPGetNativeDisplay("wl");
+ struct wl_display *wl = mpgl_get_native_display(gl, "wl");
return wl ? vaGetDisplayWl(wl) : NULL;
}
#endif
@@ -76,7 +76,7 @@ static VADisplay *create_wayland_va_display(GL *gl)
static VADisplay *create_drm_va_display(GL *gl)
{
- int drm_fd = (intptr_t)gl->MPGetNativeDisplay("drm");
+ int drm_fd = (intptr_t)mpgl_get_native_display(gl, "drm");
// Note: yes, drm_fd==0 could be valid - but it's rare and doesn't fit with
// our slightly crappy way of passing it through, so consider 0 not
// valid.
@@ -103,8 +103,6 @@ static const struct va_create_native create_native_cbs[] = {
static VADisplay *create_native_va_display(GL *gl, struct mp_log *log)
{
- if (!gl->MPGetNativeDisplay)
- return NULL;
for (int n = 0; n < MP_ARRAY_SIZE(create_native_cbs); n++) {
const struct va_create_native *disp = &create_native_cbs[n];
mp_verbose(log, "Trying to open a %s VA display...\n", disp->name);