From efa5a41dbc2aaf9dbb42f2dcc09de9fb9c86a0a7 Mon Sep 17 00:00:00 2001 From: Arnaud Vrac Date: Tue, 26 Aug 2014 20:14:40 +0200 Subject: [PATCH] buffer: do not touch memory tag flag when copying buffer flags 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 --- gst/gstbuffer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gst/gstbuffer.c b/gst/gstbuffer.c index 24efc56bc9..eb7077a83a 100644 --- a/gst/gstbuffer.c +++ b/gst/gstbuffer.c @@ -397,7 +397,11 @@ gst_buffer_copy_into (GstBuffer * dest, GstBuffer * src, 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) {