summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2011-06-10 16:19:46 +0200
committerWim Taymans <wim.taymans@collabora.co.uk>2011-06-10 16:19:46 +0200
commit7c475cc60f4d953dbe52e22e06dd4a2a7fe1a989 (patch)
tree6cf8164ccffb867fdadd64abfefa8fe5f380e26f
parent17ff81fc7da50860060fc78119508c403e1332c7 (diff)
memory: fix is_span
Subtract the offset of the parent from is_span.
-rw-r--r--gst/gstmemory.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gst/gstmemory.c b/gst/gstmemory.c
index a040cef8d..78794bb46 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;