capsfeatures: Make sure that the static ANY/EMPTY capsfeatures are never mutable
authorSebastian Dröge <sebastian@centricular.com>
Tue, 4 Feb 2014 16:48:54 +0000 (17:48 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 4 Feb 2014 16:51:11 +0000 (17:51 +0100)
See https://bugzilla.gnome.org/show_bug.cgi?id=723236

gst/gstcapsfeatures.c

index b22da1c..38fcef7 100644 (file)
@@ -66,6 +66,7 @@ struct _GstCapsFeatures
 };
 
 GType _gst_caps_features_type = 0;
+static gint static_caps_features_parent_refcount = G_MAXINT;
 GstCapsFeatures *_gst_caps_features_any = NULL;
 GstCapsFeatures *_gst_caps_features_memory_system_memory = NULL;
 static GQuark _gst_caps_feature_memory_system_memory = 0;
@@ -95,8 +96,13 @@ _priv_gst_caps_features_initialize (void)
       gst_caps_features_transform_to_string);
 
   _gst_caps_features_any = gst_caps_features_new_any ();
+  gst_caps_features_set_parent_refcount (_gst_caps_features_any,
+      &static_caps_features_parent_refcount);
   _gst_caps_features_memory_system_memory =
       gst_caps_features_new_id (_gst_caps_feature_memory_system_memory, 0);
+  gst_caps_features_set_parent_refcount
+      (_gst_caps_features_memory_system_memory,
+      &static_caps_features_parent_refcount);
 }
 
 gboolean