summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/hwdec_d3d11egl.c
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2021-11-15 21:28:56 +0100
committersfan5 <sfan5@live.de>2021-11-17 22:38:34 +0100
commitc3d78b00173a37f715510761f4cd6d01b1e403a2 (patch)
treec791bb6c91bcb42eb3351b466c51f2e018d9c90c /video/out/opengl/hwdec_d3d11egl.c
parentf5cc28a627bc2adc3ce63e69384905a0c3fea66b (diff)
downloadmpv-c3d78b00173a37f715510761f4cd6d01b1e403a2.tar.bz2
mpv-c3d78b00173a37f715510761f4cd6d01b1e403a2.tar.xz
video: opengl: use gl_check_extension() instead of strstr()
Using a simple substring match for extension checks is considered bad practice because it's incorrect when one extension is a prefix of another's name. This will almost surely not make a difference in practice but do it for correctness anyway.
Diffstat (limited to 'video/out/opengl/hwdec_d3d11egl.c')
-rw-r--r--video/out/opengl/hwdec_d3d11egl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/video/out/opengl/hwdec_d3d11egl.c b/video/out/opengl/hwdec_d3d11egl.c
index 762050359b..4a91267bbe 100644
--- a/video/out/opengl/hwdec_d3d11egl.c
+++ b/video/out/opengl/hwdec_d3d11egl.c
@@ -101,11 +101,11 @@ static int init(struct ra_hwdec *hw)
GL *gl = ra_gl_get(hw->ra);
const char *exts = eglQueryString(egl_display, EGL_EXTENSIONS);
- if (!exts || !strstr(exts, "EGL_ANGLE_d3d_share_handle_client_buffer") ||
+ if (!gl_check_extension(exts, "EGL_ANGLE_d3d_share_handle_client_buffer") ||
!gl_check_extension(exts, "EGL_ANGLE_stream_producer_d3d_texture") ||
- !(strstr(gl->extensions, "GL_OES_EGL_image_external_essl3") ||
+ !(gl_check_extension(gl->extensions, "GL_OES_EGL_image_external_essl3") ||
gl->es == 200) ||
- !strstr(exts, "EGL_EXT_device_query") ||
+ !gl_check_extension(exts, "EGL_EXT_device_query") ||
!(gl->mpgl_caps & MPGL_CAP_TEX_RG))
return -1;