validate: Allow connecting reporters by name for overrides
authorThibault Saunier <tsaunier@igalia.com>
Sun, 28 Oct 2018 14:54:47 +0000 (14:54 +0000)
committerThibault Saunier <tsaunier@igalia.com>
Sun, 28 Oct 2018 14:54:47 +0000 (14:54 +0000)
Using the element that owns the pad on which we are connecting
was not making sense.

validate/gst/validate/gst-validate-override-registry.c

index dabe209..238fa2d 100644 (file)
@@ -30,6 +30,7 @@
 #include <gmodule.h>
 
 #include "gst-validate-report.h"
+#include "gst-validate-reporter.h"
 #include "gst-validate-utils.h"
 #include "gst-validate-internal.h"
 #include "gst-validate-monitor.h"
@@ -175,9 +176,9 @@ static void
 {
   GstValidateOverrideRegistryNameEntry *entry;
   GList *iter;
-  gchar *name;
+  const gchar *name;
 
-  name = gst_validate_monitor_get_element_name (monitor);
+  name = gst_validate_reporter_get_name (GST_VALIDATE_REPORTER (monitor));
   for (iter = registry->name_overrides.head; iter; iter = g_list_next (iter)) {
     entry = iter->data;
     if (g_regex_match_simple (entry->name, name, 0, 0)) {
@@ -186,8 +187,6 @@ static void
       gst_validate_monitor_attach_override (monitor, entry->override);
     }
   }
-
-  g_free (name);
 }
 
 static void