From d747c65d4c82bf07f11309ce07a1f86e505c340c Mon Sep 17 00:00:00 2001 From: Vineeth T M Date: Mon, 17 Nov 2014 09:36:52 +0530 Subject: [PATCH] glcontext: build errors when GST_GL_HAVE_OPENGL is 0 Moving variables within #if GST_GL_HAVE_OPENGL, which are not going to be used otherwise. and which are needed only when OpenGl is present https://bugzilla.gnome.org/show_bug.cgi?id=740235 --- gst-libs/gst/gl/gstglcontext.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gst-libs/gst/gl/gstglcontext.c b/gst-libs/gst/gl/gstglcontext.c index a5843f58fd..3970a99893 100644 --- a/gst-libs/gst/gl/gstglcontext.c +++ b/gst-libs/gst/gl/gstglcontext.c @@ -445,7 +445,9 @@ GstGLAPI gst_gl_context_get_current_gl_api (guint * major, guint * minor) { const GLubyte *(*GetString) (GLenum name); +#if GST_GL_HAVE_OPENGL void (*GetIntegerv) (GLenum name, GLuint * n); +#endif const gchar *version; gint maj, min, n; GstGLAPI ret = (1 << 31); @@ -455,8 +457,10 @@ gst_gl_context_get_current_gl_api (guint * major, guint * minor) while (ret != GST_GL_API_NONE) { /* FIXME: attempt to delve into the platform specific GetProcAddress */ GetString = gst_gl_context_default_get_proc_address (ret, "glGetString"); +#if GST_GL_HAVE_OPENGL GetIntegerv = gst_gl_context_default_get_proc_address (ret, "glGetIntegerv"); +#endif if (!GetString) { goto next; } @@ -490,7 +494,9 @@ gst_gl_context_get_current_gl_api (guint * major, guint * minor) goto next; } else { +#if GST_GL_HAVE_OPENGL GLuint context_flags = 0; +#endif sscanf (version, "%d.%d", &maj, &min); if (maj <= 0 || min < 0)