summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorMiguel Paris <mparisdiaz@gmail.com>2020-03-03 15:36:26 +0100
committerTim-Philipp Müller <tim@centricular.com>2020-06-04 21:49:02 +0000
commit687c0f0ce712e74a450a8392409d65a0137df63a (patch)
tree74d08ec2cecea77e28165e2eb9322d2ff42b44a6 /gst
parente3afb0ea8eb3322441efc8d66e0c9ddc64ee887b (diff)
bufferlist: foreach: always remove as parent if buffer is changed
In case the buffer is not writable, the parent (the BufferList) is not removed before calling func. So if it is changed, the parent (the BufferList) of the previous buffer should be removed after calling func.
Diffstat (limited to 'gst')
-rw-r--r--gst/gstbufferlist.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gst/gstbufferlist.c b/gst/gstbufferlist.c
index 2c1359769e..f419b3c32d 100644
--- a/gst/gstbufferlist.c
+++ b/gst/gstbufferlist.c
@@ -307,8 +307,11 @@ gst_buffer_list_foreach (GstBufferList * list, GstBufferListFunc func,
gst_buffer_list_remove_range_internal (list, i, 1, !was_writable);
--len;
} else {
- if (!was_writable)
+ if (!was_writable) {
+ gst_mini_object_remove_parent (GST_MINI_OBJECT_CAST (buf),
+ GST_MINI_OBJECT_CAST (list));
gst_buffer_unref (buf);
+ }
list->buffers[i] = buf_ret;
gst_mini_object_add_parent (GST_MINI_OBJECT_CAST (buf_ret),