diff options
author | Julien Isorce <julien.isorce@collabora.co.uk> | 2014-04-24 16:05:32 +0100 |
---|---|---|
committer | Julien Isorce <julien.isorce@collabora.co.uk> | 2014-04-24 16:57:01 +0100 |
commit | 3db1e3e1ed16babaa9408bcd852e018d2c1cb889 (patch) | |
tree | d073161a9bf00547931a6540eeb0420f4904c267 /ext | |
parent | 673b813ab38f7676f6fe43b2660b1c45c673cb1a (diff) | |
download | gstreamer-plugins-bad-3db1e3e1ed16babaa9408bcd852e018d2c1cb889.tar.gz |
gl: fails glimagesink when shader compilation went wrong
Those shaders are fixed and very simple so it should not fail
but it's worth to handle a such case.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/gl/gstglimagesink.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c index 1bcba1b57..cfb11f033 100644 --- a/ext/gl/gstglimagesink.c +++ b/ext/gl/gstglimagesink.c @@ -998,6 +998,7 @@ gst_glimage_sink_thread_init_redisplay (GstGLImageSink * gl_sink) g_error_free (error); error = NULL; gst_gl_context_clear_shader (gl_sink->context); + gst_glimage_sink_cleanup_glthread (gl_sink); } else { gl_sink->redisplay_attr_position_loc = gst_gl_shader_get_attribute_location (gl_sink->redisplay_shader, @@ -1214,9 +1215,15 @@ gst_glimage_sink_redisplay (GstGLImageSink * gl_sink) #if GST_GL_HAVE_GLES2 if (USING_GLES2 (gl_sink->context)) { - if (!gl_sink->redisplay_shader) { + if (G_UNLIKELY (!gl_sink->redisplay_shader)) { gst_gl_window_send_message (window, GST_GL_WINDOW_CB (gst_glimage_sink_thread_init_redisplay), gl_sink); + + /* if the shader is still null it means it failed to be useable */ + if (G_UNLIKELY (!gl_sink->redisplay_shader)) { + gst_object_unref (window); + return FALSE; + } } } #endif |