[vlc-devel] [PATCH 2/2] egl: use helper function vlc_gl_StrHasToken
Thomas Guillem
thomas at gllm.fr
Wed May 23 14:43:52 CEST 2018
Indeed.
On Wed, May 23, 2018, at 13:51, Zhao Zhili wrote:
> ---
> modules/video_output/opengl/egl.c | 21 ++-------------------
> 1 file changed, 2 insertions(+), 19 deletions(-)
>
> diff --git a/modules/video_output/opengl/egl.c b/modules/video_output/
> opengl/egl.c
> index 4543f2d..3cfc3f4 100644
> --- a/modules/video_output/opengl/egl.c
> +++ b/modules/video_output/opengl/egl.c
> @@ -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
> --
> 2.9.5
>
>
>
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list