From edbfc492bb9d8238c39ec78c95d812054f6879b7 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 29 Mar 2011 17:17:46 +0200 Subject: [PATCH] buffer: implement COPY_MERGE --- gst/gstbuffer.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gst/gstbuffer.c b/gst/gstbuffer.c index e3ce594d98..8faadaac69 100644 --- a/gst/gstbuffer.c +++ b/gst/gstbuffer.c @@ -169,6 +169,9 @@ _span_memory (GstBuffer * buffer, gsize offset, gsize size) /* not enough room, span buffers */ mem[0] = GST_BUFFER_MEM_ARRAY (buffer); len[0] = GST_BUFFER_MEM_LEN (buffer); + if (len[0] == 1) + return; + span = _gst_buffer_arr_span (mem, len, 1, offset, size); /* unref old buffers */ @@ -324,6 +327,9 @@ gst_buffer_copy_into (GstBuffer * dest, GstBuffer * src, left -= tocopy; } } + if (flags & GST_BUFFER_COPY_MERGE) { + _span_memory (dest, 0, size); + } } for (walk = GST_BUFFER_META (src); walk; walk = walk->next) {