diff options
author | Matthew Waters <ystreet00@gmail.com> | 2014-06-03 13:59:51 +1000 |
---|---|---|
committer | Matthew Waters <ystreet00@gmail.com> | 2014-06-03 14:03:21 +1000 |
commit | 59088f5a90960cde183a72bde2754be749750aa6 (patch) | |
tree | b8f83dc8945e691ec2393103b80045caf2f79e6d | |
parent | e72f0eadd8b9c342f6979d10e3e70b3b49ef2672 (diff) |
glupload: always release the previous buffer
Fixes the case where _perform_with_buffer() is called without
intervening calls to _release_buffer() as is the case on start up
with glimagesink.
Also release the buffer when reseting the upload.
https://bugzilla.gnome.org/show_bug.cgi?id=731107
-rw-r--r-- | gst-libs/gst/gl/gstglupload.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gst-libs/gst/gl/gstglupload.c b/gst-libs/gst/gl/gstglupload.c index 7127b3a18..ed54dfe57 100644 --- a/gst-libs/gst/gl/gstglupload.c +++ b/gst-libs/gst/gl/gstglupload.c @@ -65,6 +65,7 @@ struct _GstGLUploadPrivate GstVideoGLTextureUploadMeta *meta; GstBuffer *outbuf; + gboolean released; }; GST_DEBUG_CATEGORY_STATIC (gst_gl_upload_debug); @@ -161,6 +162,8 @@ gst_gl_upload_reset (GstGLUpload * upload) upload->in_tex[i] = NULL; } } + + gst_gl_upload_release_buffer (upload); } static void @@ -241,6 +244,8 @@ gst_gl_upload_perform_with_buffer (GstGLUpload * upload, GstBuffer * buffer, g_return_val_if_fail (tex_id != NULL, FALSE); g_return_val_if_fail (gst_buffer_n_memory (buffer) > 0, FALSE); + gst_gl_upload_release_buffer (upload); + /* GstGLMemory */ mem = gst_buffer_peek_memory (buffer, 0); @@ -330,6 +335,8 @@ gst_gl_upload_release_buffer (GstGLUpload * upload) gst_buffer_unref (upload->priv->outbuf); upload->priv->outbuf = NULL; } + + upload->priv->released = TRUE; } /* @@ -539,6 +546,7 @@ _upload_memory (GstGLUpload * upload) upload->out_tex->tex_id = *(guint *) out_frame.data[0]; gst_video_frame_unmap (&out_frame); + upload->priv->released = FALSE; return TRUE; } |