From: Thibault Saunier Date: Mon, 16 Apr 2018 19:27:57 +0000 (-0300) Subject: harness: Handle harness->element not being a GstBin X-Git-Tag: 1.16.2~406 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0b86481adf809cbc024ef5a51d75971fdbc24bd4;p=platform%2Fupstream%2Fgstreamer.git harness: Handle harness->element not being a GstBin It is totally valid but in gst_harness_find_element we were not handling that case. https://bugzilla.gnome.org/show_bug.cgi?id=795308 --- diff --git a/libs/gst/check/gstharness.c b/libs/gst/check/gstharness.c index 5909ced..ef965b8 100644 --- a/libs/gst/check/gstharness.c +++ b/libs/gst/check/gstharness.c @@ -2500,6 +2500,18 @@ gst_harness_find_element (GstHarness * h, const gchar * element_name) GstIterator *iter; GValue data = G_VALUE_INIT; + if (!GST_IS_BIN (h->element)) { + GstPluginFeature *feature; + + g_return_val_if_fail (GST_IS_ELEMENT (h->element), NULL); + + feature = GST_PLUGIN_FEATURE (gst_element_get_factory (h->element)); + if (!strcmp (element_name, gst_plugin_feature_get_name (feature))) + return gst_object_ref (h->element); + + return NULL; + } + iter = gst_bin_iterate_elements (GST_BIN (h->element)); done = FALSE;