From 32f18993540fa7cbf203c6b9634827be344f8d0b Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 16 May 2011 18:12:33 +0200 Subject: [PATCH] caps: only add the structure when we could set the parent --- gst/gstcaps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gst/gstcaps.c b/gst/gstcaps.c index 27feca2..96033c5 100644 --- a/gst/gstcaps.c +++ b/gst/gstcaps.c @@ -96,8 +96,8 @@ /* quick way to append a structure without checking the args */ #define gst_caps_append_structure_unchecked(caps, structure) G_STMT_START{\ GstStructure *__s=structure; \ - gst_structure_set_parent_refcount (__s, &GST_MINI_OBJECT_REFCOUNT(caps)); \ - g_ptr_array_add (caps->structs, __s); \ + if (gst_structure_set_parent_refcount (__s, &GST_MINI_OBJECT_REFCOUNT(caps))) \ + g_ptr_array_add (caps->structs, __s); \ }G_STMT_END /* lock to protect multiple invocations of static caps to caps conversion */ -- 2.7.4