diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-02-27 20:21:23 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-02-27 20:21:23 +0100 |
commit | 546bfbecb8dec16f784c0b10b64874d0b5b5d18e (patch) | |
tree | 6cd9c01cbe18fec62b2d39077705ba2f89412eb2 /gst/xdgmime/gstxdgmime.c | |
parent | 41b65b421b5f30895167351e6cc91ecec11c4e90 (diff) | |
download | gstreamer-plugins-bad-546bfbecb8dec16f784c0b10b64874d0b5b5d18e.tar.gz |
xdgmime: Use empty caps for registering the typefinders with old core versions
core before 0.10.22.1 produced assertions when storing typefind factories
with NULL caps in the registry.
Diffstat (limited to 'gst/xdgmime/gstxdgmime.c')
-rw-r--r-- | gst/xdgmime/gstxdgmime.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/gst/xdgmime/gstxdgmime.c b/gst/xdgmime/gstxdgmime.c index 1d7536c3b..c2eec58dc 100644 --- a/gst/xdgmime/gstxdgmime.c +++ b/gst/xdgmime/gstxdgmime.c @@ -55,10 +55,25 @@ xdgmime_typefind (GstTypeFind * find, gpointer user_data) static gboolean plugin_init (GstPlugin * plugin) { + GstCaps *caps = NULL; + guint major, minor, micro, nano; + gboolean ret; + + /* FIXME: GStreamer before 0.10.22.1 produced assertions + * when storing typefind factories with NULL caps */ + gst_version (&major, &minor, µ, &nano); + if (major <= 0 && minor <= 10 && micro <= 22 && nano <= 0) + caps = gst_caps_new_empty (); + GST_DEBUG_CATEGORY_INIT (xdgmime_debug, "xdgmime", 0, "XDG-MIME"); - return gst_type_find_register (plugin, - "xdgmime", GST_RANK_MARGINAL, xdgmime_typefind, NULL, NULL, NULL, NULL); + ret = gst_type_find_register (plugin, + "xdgmime", GST_RANK_MARGINAL, xdgmime_typefind, NULL, caps, NULL, NULL); + + if (caps) + gst_caps_unref (caps); + + return ret; } GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, |