Commit 323e604d authored by Zhao Zhili's avatar Zhao Zhili Committed by Thomas Guillem

egl: use helper function vlc_gl_StrHasToken

Signed-off-by: Thomas Guillem's avatarThomas Guillem <thomas@gllm.fr>
parent e6bf9bce
......@@ -123,33 +123,16 @@ static bool DestroyImageKHR(vlc_gl_t *gl, void *image)
return sys->eglDestroyImageKHR(sys->display, image);
}
static bool CheckToken(const char *haystack, const char *needle)
{
size_t len = strlen(needle);
while (haystack != NULL)
{
while (*haystack == ' ')
haystack++;
if (!strncmp(haystack, needle, len)
&& (memchr(" ", haystack[len], 2) != NULL))
return true;
haystack = strchr(haystack, ' ');
}
return false;
}
static bool CheckAPI (EGLDisplay dpy, const char *api)
{
const char *apis = eglQueryString (dpy, EGL_CLIENT_APIS);
return CheckToken(apis, api);
return vlc_gl_StrHasToken(apis, api);
}
static bool CheckClientExt(const char *name)
{
const char *exts = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
return CheckToken(exts, name);
return vlc_gl_StrHasToken(exts, name);
}
struct gl_api
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment