Make GST_PROPS_PROPERTIES return NULL when props is NULL. This allows
authorAndy Wingo <wingo@pobox.com>
Mon, 6 Oct 2003 14:03:05 +0000 (14:03 +0000)
committerAndy Wingo <wingo@pobox.com>
Mon, 6 Oct 2003 14:03:05 +0000 (14:03 +0000)
Original commit message from CVS:
Make GST_PROPS_PROPERTIES return NULL when props is NULL. This allows
GST_PROPS_PROPERTIES (gst_caps_get_props (caps)) even if the caps have no props.

gst/gstprops.h

index 7f01f83..2ff2a06 100644 (file)
@@ -106,7 +106,7 @@ typedef enum {
 #define GST_PROPS_FLAG_UNSET(props,flag)  (GST_PROPS_FLAGS (props) &= ~(flag))
 
 #define GST_PROPS_REFCOUNT(props)         ((props)->refcount)
-#define GST_PROPS_PROPERTIES(props)       ((props)->properties)
+#define GST_PROPS_PROPERTIES(props)       ((props) ? ((props)->properties) : NULL)
 
 #define GST_PROPS_IS_FIXED(props)         (GST_PROPS_FLAG_IS_SET ((props), GST_PROPS_FIXED))
 #define GST_PROPS_IS_FLOATING(props)      (GST_PROPS_FLAG_IS_SET ((props), GST_PROPS_FLOATING))