diff options
author | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2010-09-16 19:27:57 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2010-09-16 19:40:15 +0100 |
commit | 80ddde400a6ad66f44ccbbbaacde2ab8c93ee792 (patch) | |
tree | 47c4c8f949bb0e248b7cf74903f280e86af625e3 | |
parent | 34abe02458b7882e27c309217b03952b2cda0b93 (diff) |
elementfactory: make sure gstreamer has been initialized when creating elements
Add gst_is_initialized() guard to gst_element_factory_make(), so
people who forgot to call gst_init() get a useful warning for what
seems to be a common enough mistake.
-rw-r--r-- | gst/gstelementfactory.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gst/gstelementfactory.c b/gst/gstelementfactory.c index bef3f1b68a..903e81208a 100644 --- a/gst/gstelementfactory.c +++ b/gst/gstelementfactory.c @@ -64,6 +64,7 @@ #include "gstinfo.h" #include "gsturi.h" #include "gstregistry.h" +#include "gst.h" #include "glib-compat-private.h" @@ -435,6 +436,7 @@ gst_element_factory_make (const gchar * factoryname, const gchar * name) GstElement *element; g_return_val_if_fail (factoryname != NULL, NULL); + g_return_val_if_fail (gst_is_initialized (), NULL); GST_LOG ("gstelementfactory: make \"%s\" \"%s\"", factoryname, GST_STR_NULL (name)); |