glvideomixer: Don't use context if not present

Avoids assertions at runtime
This commit is contained in:
Edward Hervey 2015-03-31 16:27:00 +02:00 committed by Edward Hervey
parent af17a2cd4f
commit 9a73ffcef3

View file

@ -709,21 +709,23 @@ static void
gst_gl_video_mixer_reset (GstGLMixer * mixer) gst_gl_video_mixer_reset (GstGLMixer * mixer)
{ {
GstGLVideoMixer *video_mixer = GST_GL_VIDEO_MIXER (mixer); GstGLVideoMixer *video_mixer = GST_GL_VIDEO_MIXER (mixer);
GstGLContext *context = GST_GL_BASE_MIXER (mixer)->context;
video_mixer->input_frames = NULL; video_mixer->input_frames = NULL;
GST_DEBUG_OBJECT (mixer, "context:%p", context);
if (video_mixer->shader) if (video_mixer->shader)
gst_gl_context_del_shader (GST_GL_BASE_MIXER (mixer)->context, gst_gl_context_del_shader (context, video_mixer->shader);
video_mixer->shader);
video_mixer->shader = NULL; video_mixer->shader = NULL;
if (video_mixer->checker) if (video_mixer->checker)
gst_gl_context_del_shader (GST_GL_BASE_MIXER (mixer)->context, gst_gl_context_del_shader (context, video_mixer->checker);
video_mixer->checker);
video_mixer->checker = NULL; video_mixer->checker = NULL;
gst_gl_context_thread_add (GST_GL_BASE_MIXER (mixer)->context, if (GST_GL_BASE_MIXER (mixer)->context)
(GstGLContextThreadFunc) _reset_gl, mixer); gst_gl_context_thread_add (context, (GstGLContextThreadFunc) _reset_gl,
mixer);
} }
static gboolean static gboolean