From 067d5c45d23798bc0d85f27c1b8a5246e0576dbe Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Fri, 13 Mar 2015 12:28:36 +0000 Subject: [PATCH] gluploadelement: properly unref buffers that are the same as the input basetransform doesn't unref equal input and output buffers --- ext/gl/gstgluploadelement.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/gl/gstgluploadelement.c b/ext/gl/gstgluploadelement.c index 56a0f53a25..1a692143dc 100644 --- a/ext/gl/gstgluploadelement.c +++ b/ext/gl/gstgluploadelement.c @@ -211,6 +211,7 @@ gst_gl_upload_element_query (GstBaseTransform * bt, GstPadDirection direction, case GST_QUERY_DRAIN: if (upload->upload) gst_gl_upload_release_buffer (upload->upload); + break; default: break; } @@ -239,6 +240,10 @@ gst_gl_upload_element_prepare_output_buffer (GstBaseTransform * bt, gst_buffer_copy_into (*outbuf, buffer, GST_BUFFER_COPY_FLAGS | GST_BUFFER_COPY_TIMESTAMPS, 0, -1); + /* basetransform doesn't unref if they're the same */ + if (buffer == *outbuf) + gst_buffer_unref (*outbuf); + return ret == GST_GL_UPLOAD_DONE ? GST_FLOW_OK : GST_FLOW_ERROR; }