From 7c475cc60f4d953dbe52e22e06dd4a2a7fe1a989 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 10 Jun 2011 16:19:46 +0200 Subject: [PATCH] memory: fix is_span Subtract the offset of the parent from is_span. --- gst/gstmemory.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gst/gstmemory.c b/gst/gstmemory.c index a040cef..78794bb 100644 --- a/gst/gstmemory.c +++ b/gst/gstmemory.c @@ -262,8 +262,14 @@ static gboolean _default_mem_is_span (GstMemoryDefault * mem1, GstMemoryDefault * mem2, gsize * offset) { - if (offset) - *offset = mem1->offset; + + if (offset) { + GstMemoryDefault *parent; + + parent = (GstMemoryDefault *) mem1->mem.parent; + + *offset = mem1->offset - parent->offset; + } /* and memory is contiguous */ return mem1->data + mem1->offset + mem1->size == mem2->data + mem2->offset; -- 2.7.4