mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-20 06:08:14 +00:00
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
This commit is contained in:
parent
d1b2d3429c
commit
0b86481adf
1 changed files with 12 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue