Allow adding a typefinder without a typefind function so that it can be used
authorWim Taymans <wim.taymans@collabora.co.uk>
Wed, 21 Jan 2009 11:45:45 +0000 (12:45 +0100)
committerWim Taymans <wim@wtay.(none)>
Wed, 21 Jan 2009 11:45:45 +0000 (12:45 +0100)
to map the caps to the extension. See #566661.

gst/gsttypefind.c
gst/gsttypefindfactory.c

index f4e6aa7..756e882 100644 (file)
@@ -78,7 +78,6 @@ gst_type_find_register (GstPlugin * plugin, const gchar * name, guint rank,
   GstTypeFindFactory *factory;
 
   g_return_val_if_fail (name != NULL, FALSE);
-  g_return_val_if_fail (func != NULL, FALSE);
 
   GST_INFO ("registering typefind function for %s", name);
 
index 2cb7c9a..6b65461 100644 (file)
@@ -238,9 +238,8 @@ gst_type_find_factory_call_function (GstTypeFindFactory * factory,
       GST_TYPE_FIND_FACTORY (gst_plugin_feature_load (GST_PLUGIN_FEATURE
           (factory)));
   if (new_factory) {
-    g_assert (new_factory->function != NULL);
-
-    new_factory->function (find, new_factory->user_data);
+    if (new_factory->function)
+      new_factory->function (find, new_factory->user_data);
     gst_object_unref (new_factory);
   }
 }