mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-30 12:10:37 +00:00
fsvalve: Fix refcounting issues in prepare_output_buffer
20080805113057-be0f2-9dc270781f0a0f21c616ed11dbd1f198fd1b326e.gz
This commit is contained in:
parent
2b612137d7
commit
ff36774a30
1 changed files with 11 additions and 4 deletions
|
@ -212,18 +212,25 @@ gst_valve_prepare_output_buffer (GstBaseTransform *trans, GstBuffer * in_buf,
|
|||
}
|
||||
else
|
||||
{
|
||||
/* Always return a reffed buffer, which in case of returning the input
|
||||
* buffer means adding an extra ref to it */
|
||||
if (valve->discont)
|
||||
{
|
||||
*out_buf = gst_buffer_make_metadata_writable (in_buf);
|
||||
GST_BUFFER_FLAG_SET (*out_buf, GST_BUFFER_FLAG_DISCONT);
|
||||
valve->discont = FALSE;
|
||||
|
||||
if (gst_buffer_is_metadata_writable (in_buf))
|
||||
{
|
||||
*out_buf = gst_buffer_ref (in_buf);
|
||||
}
|
||||
else
|
||||
{
|
||||
*out_buf = in_buf;
|
||||
*out_buf = gst_buffer_create_sub (in_buf, 0, GST_BUFFER_SIZE (in_buf));
|
||||
}
|
||||
GST_BUFFER_FLAG_SET (*out_buf, GST_BUFFER_FLAG_DISCONT);
|
||||
valve->discont = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
*out_buf = gst_buffer_ref(in_buf);
|
||||
}
|
||||
gst_buffer_ref (*out_buf);
|
||||
}
|
||||
GST_OBJECT_UNLOCK (GST_OBJECT (trans));
|
||||
|
||||
|
|
Loading…
Reference in a new issue