From: Matthew Waters Date: Tue, 6 May 2014 23:11:25 +0000 (+1000) Subject: gl/sink: make sure we always initialize the upload object X-Git-Tag: 1.19.3~511^2~1989^2~1505 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a865a931fcb5c08ce9fe9a649545c05da3c931ac;p=platform%2Fupstream%2Fgstreamer.git gl/sink: make sure we always initialize the upload object https://bugzilla.gnome.org/show_bug.cgi?id=729542 --- diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c index 7b3d171..1cd5c5e 100644 --- a/ext/gl/gstglimagesink.c +++ b/ext/gl/gstglimagesink.c @@ -687,9 +687,21 @@ gst_glimage_sink_set_caps (GstBaseSink * bsink, GstCaps * caps) gst_object_unref (oldpool); } + if (glimage_sink->upload) + gst_object_unref (glimage_sink->upload); glimage_sink->upload = gst_object_ref (GST_GL_BUFFER_POOL (newpool)->upload); + if (!gst_gl_upload_init_format (glimage_sink->upload, &vinfo)) + goto upload_error; + return TRUE; + +upload_error: + { + GST_ELEMENT_ERROR (glimage_sink, RESOURCE, NOT_FOUND, + ("%s", "Failed to initialize upload resources"), (NULL)); + return FALSE; + } } static GstFlowReturn