diff options
author | Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> | 2016-10-03 13:11:07 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2018-01-29 09:58:00 +0000 |
commit | 782fb43887ad5377c3dbc57f65ead1cd62cab18d (patch) | |
tree | 1f50d8996457143d73aa8556ec7ac78a34639785 /ext | |
parent | e9aa11720071f8a1d22b336395e66dd8cbca0c00 (diff) | |
download | gstreamer-plugins-bad-782fb43887ad5377c3dbc57f65ead1cd62cab18d.tar.gz |
glvideomixer: fix vertex_buffer leak
We call the base class first as this will remove the pad from
the aggregator, thus stopping misc callbacks from being called,
one of which (process_textures) will recreate the vertex_buffer
if it is destroyed
https://bugzilla.gnome.org/show_bug.cgi?id=760873
Diffstat (limited to 'ext')
-rw-r--r-- | ext/gl/gstglvideomixer.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/gl/gstglvideomixer.c b/ext/gl/gstglvideomixer.c index 487bf2fe1..78b5d06c5 100644 --- a/ext/gl/gstglvideomixer.c +++ b/ext/gl/gstglvideomixer.c @@ -841,14 +841,20 @@ static void gst_gl_video_mixer_release_pad (GstElement * element, GstPad * p) { GstGLVideoMixerPad *pad = GST_GL_VIDEO_MIXER_PAD (p); + + /* we call the base class first as this will remove the pad from + * the aggregator, thus stopping misc callbacks from being called, + * one of which (process_textures) will recreate the vertex_buffer + * if it is destroyed */ + GST_ELEMENT_CLASS (g_type_class_peek_parent (G_OBJECT_GET_CLASS (element))) + ->release_pad (element, p); + if (pad->vertex_buffer) { GstGLBaseMixer *mix = GST_GL_BASE_MIXER (element); gst_gl_context_thread_add (mix->context, (GstGLContextThreadFunc) _del_buffer, &pad->vertex_buffer); pad->vertex_buffer = 0; } - GST_ELEMENT_CLASS (g_type_class_peek_parent (G_OBJECT_GET_CLASS (element))) - ->release_pad (element, p); } static void |