diff --git a/ext/gl/gstgluploadelement.c b/ext/gl/gstgluploadelement.c index 056c1beabd..a8971d8138 100644 --- a/ext/gl/gstgluploadelement.c +++ b/ext/gl/gstgluploadelement.c @@ -239,9 +239,6 @@ gst_gl_upload_element_prepare_output_buffer (GstBaseTransform * bt, /* basetransform doesn't unref if they're the same */ if (buffer == *outbuf) gst_buffer_unref (*outbuf); - else if (*outbuf) - gst_buffer_copy_into (*outbuf, buffer, - GST_BUFFER_COPY_FLAGS | GST_BUFFER_COPY_TIMESTAMPS, 0, -1); return ret == GST_GL_UPLOAD_DONE ? GST_FLOW_OK : GST_FLOW_ERROR; } diff --git a/gst-libs/gst/gl/gstglupload.c b/gst-libs/gst/gl/gstglupload.c index d675f12625..635477fa1b 100644 --- a/gst-libs/gst/gl/gstglupload.c +++ b/gst-libs/gst/gl/gstglupload.c @@ -1109,8 +1109,12 @@ restart: NEXT_METHOD; } - if (outbuf_ptr) + if (outbuf_ptr) { + if (buffer != upload->priv->outbuf) + gst_buffer_copy_into (upload->priv->outbuf, buffer, + GST_BUFFER_COPY_FLAGS | GST_BUFFER_COPY_TIMESTAMPS, 0, -1); *outbuf_ptr = gst_buffer_ref (upload->priv->outbuf); + } GST_OBJECT_UNLOCK (upload);