glupload/colorconvert: only copy timestamps if the input buffer != output

This commit is contained in:
Matthew Waters 2015-03-14 10:39:06 +00:00
parent 802bf79998
commit 0c8ede8565
2 changed files with 6 additions and 4 deletions

View file

@ -190,6 +190,9 @@ gst_gl_color_convert_element_prepare_output_buffer (GstBaseTransform * bt,
*outbuf = gst_gl_color_convert_perform (convert->convert, inbuf);
/* basetransform doesn't unref if they're the same */
if (inbuf == *outbuf)
gst_buffer_unref (*outbuf);
if (*outbuf)
gst_buffer_copy_into (*outbuf, inbuf,
GST_BUFFER_COPY_FLAGS | GST_BUFFER_COPY_TIMESTAMPS, 0, -1);

View file

@ -236,13 +236,12 @@ gst_gl_upload_element_prepare_output_buffer (GstBaseTransform * bt,
ret = gst_gl_upload_perform_with_buffer (upload->upload, buffer, outbuf);
if (*outbuf)
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);
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;
}