diff options
author | Niels De Graef <nielsdegraef@gmail.com> | 2018-11-04 18:52:50 +0100 |
---|---|---|
committer | Sebastian Dröge <slomo@coaxion.net> | 2018-11-05 11:06:30 +0000 |
commit | fa1d7a86aff0af42f4887fe1cd79689a1db942a1 (patch) | |
tree | 91754e0f6d719197a47c77ceee97b2785a568fd9 /gst/gstbufferlist.h | |
parent | 1068d9e2c823041d3f75d5a99006e8ef51aec0ae (diff) |
bufferlist: add gst_clear_buffer_list()
Basically, you can use this instead of using gst_buffer_list_unref
(which needs to be preceded by a NULL-check).
Also fixes #275
Diffstat (limited to 'gst/gstbufferlist.h')
-rw-r--r-- | gst/gstbufferlist.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gst/gstbufferlist.h b/gst/gstbufferlist.h index ce9fe11574..529a12be33 100644 --- a/gst/gstbufferlist.h +++ b/gst/gstbufferlist.h @@ -93,6 +93,25 @@ gst_buffer_list_unref (GstBufferList * list) gst_mini_object_unref (GST_MINI_OBJECT_CAST (list)); } +/** + * gst_clear_buffer_list: (skip) + * @list_ptr: a pointer to a #GstBufferList reference + * + * Clears a reference to a #GstBufferList. + * + * @list_ptr must not be %NULL. + * + * If the reference is %NULL then this function does nothing. Otherwise, the + * reference count of the list is decreased and the pointer is set to %NULL. + * + * Since: 1.16 + */ +static inline void +gst_clear_buffer_list (GstBufferList ** list_ptr) +{ + gst_clear_mini_object (list_ptr); +} + /* copy */ /** * gst_buffer_list_copy: |