mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-26 18:20:44 +00:00
buffer: add gst_clear_buffer()
Basically, you can use this instead of using gst_buffer_unref (which needs to be preceded by a NULL-check). Also fixes #275
This commit is contained in:
parent
7e69305657
commit
1068d9e2c8
1 changed files with 19 additions and 0 deletions
|
@ -442,6 +442,25 @@ gst_buffer_unref (GstBuffer * buf)
|
||||||
gst_mini_object_unref (GST_MINI_OBJECT_CAST (buf));
|
gst_mini_object_unref (GST_MINI_OBJECT_CAST (buf));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_clear_buffer: (skip)
|
||||||
|
* @buf_ptr: a pointer to a #GstBuffer reference
|
||||||
|
*
|
||||||
|
* Clears a reference to a #GstBuffer.
|
||||||
|
*
|
||||||
|
* @buf_ptr must not be %NULL.
|
||||||
|
*
|
||||||
|
* If the reference is %NULL then this function does nothing. Otherwise, the
|
||||||
|
* reference count of the buffer is decreased and the pointer is set to %NULL.
|
||||||
|
*
|
||||||
|
* Since: 1.16
|
||||||
|
*/
|
||||||
|
static inline void
|
||||||
|
gst_clear_buffer (GstBuffer ** buf_ptr)
|
||||||
|
{
|
||||||
|
gst_clear_mini_object (buf_ptr);
|
||||||
|
}
|
||||||
|
|
||||||
/* copy buffer */
|
/* copy buffer */
|
||||||
/**
|
/**
|
||||||
* gst_buffer_copy:
|
* gst_buffer_copy:
|
||||||
|
|
Loading…
Reference in a new issue