mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 11:32:38 +00:00
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.
This commit is contained in:
parent
34abe02458
commit
80ddde400a
1 changed files with 2 additions and 0 deletions
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue