ges: Make sure not to initialize twice
authorThibault Saunier <thibault.saunier@collabora.com>
Tue, 27 Nov 2012 15:53:14 +0000 (12:53 -0300)
committerThibault Saunier <thibault.saunier@collabora.com>
Sat, 29 Dec 2012 22:36:50 +0000 (19:36 -0300)
ges/ges.c

index af8cb42..4b6dea7 100644 (file)
--- a/ges/ges.c
+++ b/ges/ges.c
@@ -27,6 +27,8 @@
 
 GST_DEBUG_CATEGORY (_ges_debug);
 
+static gboolean ges_initialized = FALSE;
+
 /**
  * SECTION:ges-common
  * @short_description: Initialization.
@@ -62,6 +64,11 @@ ges_init (void)
   GST_DEBUG_CATEGORY_INIT (_ges_debug, "ges", GST_DEBUG_FG_YELLOW,
       "GStreamer Editing Services");
 
+  if (ges_initialized) {
+    GST_DEBUG ("already initialized ges");
+    return TRUE;
+  }
+
   /* register timeline object classes with the system */
 
   GES_TYPE_TIMELINE_TEST_SOURCE;
@@ -86,6 +93,7 @@ ges_init (void)
     return FALSE;
 
   /* TODO: user-defined types? */
+  ges_initialized = TRUE;
 
   GST_DEBUG ("GStreamer Editing Services initialized");