summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorAlessandro Decina <alessandro.d@gmail.com>2016-09-05 14:44:24 +1000
committerAlessandro Decina <alessandro.d@gmail.com>2016-09-05 14:44:24 +1000
commitc16d57cc9a64f1aeaa20ac079feb21f33893224d (patch)
tree182d092e9e8ca738e12d526b8477b3075998041a /ext
parent35d147930d5ab1c3549e4413202954f21a7db0fa (diff)
glupload: create the GstGLUpload object in ::transform_caps
Previously it was created in the init function and destroyed in ::stop, which lead to segfaults when reusing the element. Now the upload object is created in ::transform_caps if it is NULL, which is the earliest we need it. The other vfuncs already bail out if the upload object is NULL, which means that negotiation wasn't done.
Diffstat (limited to 'ext')
-rw-r--r--ext/gl/gstgluploadelement.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/gl/gstgluploadelement.c b/ext/gl/gstgluploadelement.c
index f458a4323..d3ed276dd 100644
--- a/ext/gl/gstgluploadelement.c
+++ b/ext/gl/gstgluploadelement.c
@@ -97,8 +97,6 @@ static void
gst_gl_upload_element_init (GstGLUploadElement * upload)
{
gst_base_transform_set_prefer_passthrough (GST_BASE_TRANSFORM (upload), TRUE);
-
- upload->upload = gst_gl_upload_new (NULL);
}
static gboolean
@@ -138,6 +136,9 @@ _gst_gl_upload_element_transform_caps (GstBaseTransform * bt,
GstGLUploadElement *upload = GST_GL_UPLOAD_ELEMENT (bt);
GstGLContext *context = GST_GL_BASE_FILTER (bt)->context;
+ if (upload->upload == NULL)
+ upload->upload = gst_gl_upload_new (NULL);
+
return gst_gl_upload_transform_caps (upload->upload, context, direction, caps,
filter);
}