mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 23:06:49 +00:00
gstglmixerbin: minor refactor of _find_element_pad_template
As suggested by @slomo, make the loop more readable and prevent returning a garbage value to the caller from the previous implementation. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2232>
This commit is contained in:
parent
8707d0cb26
commit
4c0d64dd10
1 changed files with 6 additions and 9 deletions
|
@ -375,25 +375,22 @@ _find_element_pad_template (GstElement * element,
|
||||||
{
|
{
|
||||||
GstElementClass *klass = GST_ELEMENT_GET_CLASS (element);
|
GstElementClass *klass = GST_ELEMENT_GET_CLASS (element);
|
||||||
GList *templ_list = gst_element_class_get_pad_template_list (klass);
|
GList *templ_list = gst_element_class_get_pad_template_list (klass);
|
||||||
GstPadTemplate *templ;
|
|
||||||
|
|
||||||
/* find suitable template */
|
/* find suitable template */
|
||||||
while (templ_list) {
|
while (templ_list) {
|
||||||
templ = (GstPadTemplate *) templ_list->data;
|
GstPadTemplate *templ = (GstPadTemplate *) templ_list->data;
|
||||||
|
|
||||||
if (GST_PAD_TEMPLATE_DIRECTION (templ) != direction
|
|
||||||
|| GST_PAD_TEMPLATE_PRESENCE (templ) != presence) {
|
|
||||||
templ_list = templ_list->next;
|
|
||||||
templ = NULL;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (GST_PAD_TEMPLATE_DIRECTION (templ) == direction
|
||||||
|
&& GST_PAD_TEMPLATE_PRESENCE (templ) == presence) {
|
||||||
return templ;
|
return templ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
templ_list = templ_list->next;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
_connect_mixer_element (GstGLMixerBin * self)
|
_connect_mixer_element (GstGLMixerBin * self)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue