validate: Attach overrides before calling monitor.setup()
authorThibault Saunier <thibault.saunier@osg.samsung.com>
Tue, 13 Jun 2017 20:08:23 +0000 (16:08 -0400)
committerThibault Saunier <thibault.saunier@osg.samsung.com>
Fri, 16 Jun 2017 21:36:34 +0000 (17:36 -0400)
validate/gst/validate/gst-validate-monitor-factory.c
validate/gst/validate/gst-validate-monitor.c

index e343273..2597ca0 100644 (file)
@@ -85,7 +85,5 @@ gst_validate_monitor_factory_create (GstObject * target,
     g_assert_not_reached ();
   }
 
-  g_object_set_data ((GObject *) target, "validate-monitor", monitor);
-  gst_validate_override_registry_attach_overrides (monitor);
   return monitor;
 }
index 925eded..04ff66d 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "gst-validate-internal.h"
 #include "gst-validate-monitor.h"
+#include "gst-validate-override-registry.h"
 
 /**
  * SECTION:gst-validate-monitor
@@ -180,6 +181,7 @@ static GObject *
 gst_validate_monitor_constructor (GType type, guint n_construct_params,
     GObjectConstructParam * construct_params)
 {
+  GstObject *target;
   GstValidateMonitor *monitor =
       GST_VALIDATE_MONITOR_CAST (G_OBJECT_CLASS (parent_class)->constructor
       (type,
@@ -200,7 +202,13 @@ gst_validate_monitor_constructor (GType type, guint n_construct_params,
     }
   }
 
+  gst_validate_override_registry_attach_overrides (monitor);
   gst_validate_monitor_setup (monitor);
+
+  target = gst_validate_monitor_get_target (monitor);
+  g_object_set_data ((GObject *) target, "validate-monitor", monitor);
+  gst_object_unref (target);
+
   return (GObject *) monitor;
 }