mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-29 19:50:40 +00:00
capsfilter: fix refcounting problem
Make sure the metadata is writable before setting the caps on a buffer.
This commit is contained in:
parent
6cf64beb79
commit
04f3f096c3
1 changed files with 9 additions and 3 deletions
|
@ -306,9 +306,15 @@ gst_capsfilter_prepare_buf (GstBaseTransform * trans, GstBuffer * input,
|
||||||
/* FIXME : Move this behaviour to basetransform. The given caps are the ones
|
/* FIXME : Move this behaviour to basetransform. The given caps are the ones
|
||||||
* of the source pad, therefore our outgoing buffers should always have
|
* of the source pad, therefore our outgoing buffers should always have
|
||||||
* those caps. */
|
* those caps. */
|
||||||
gst_buffer_set_caps (input, caps);
|
if (gst_buffer_is_metadata_writable (input)) {
|
||||||
gst_buffer_ref (input);
|
*buf = input;
|
||||||
*buf = input;
|
gst_buffer_set_caps (*buf, caps);
|
||||||
|
gst_buffer_ref (input);
|
||||||
|
} else {
|
||||||
|
GST_DEBUG_OBJECT (trans, "Creating sub-buffer and setting caps");
|
||||||
|
*buf = gst_buffer_create_sub (input, 0, GST_BUFFER_SIZE (input));
|
||||||
|
gst_buffer_set_caps (*buf, caps);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Buffer has no caps. See if the output pad only supports fixed caps */
|
/* Buffer has no caps. See if the output pad only supports fixed caps */
|
||||||
GstCaps *out_caps;
|
GstCaps *out_caps;
|
||||||
|
|
Loading…
Reference in a new issue