The tag memory flag will be set later if the memory is also copied. This
patch avoids buffers being freed needlessly in bufferpools.
https://bugzilla.gnome.org/show_bug.cgi?id=735574
if (flags & GST_BUFFER_COPY_FLAGS) {
/* copy flags */
- GST_MINI_OBJECT_FLAGS (dest) = GST_MINI_OBJECT_FLAGS (src);
+ guint flags_mask = ~GST_BUFFER_FLAG_TAG_MEMORY;
+
+ GST_MINI_OBJECT_FLAGS (dest) =
+ (GST_MINI_OBJECT_FLAGS (src) & flags_mask) |
+ (GST_MINI_OBJECT_FLAGS (dest) & ~flags_mask);
}
if (flags & GST_BUFFER_COPY_TIMESTAMPS) {