mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
aggregator: don't compare templ instance pointers
One can pass the PadTemplate from the element_class or the one from the factory. While they have the same content, the addresses are different.
This commit is contained in:
parent
0b9aea86f8
commit
c1fa51953c
1 changed files with 30 additions and 25 deletions
|
@ -1312,13 +1312,14 @@ gst_aggregator_default_create_new_pad (GstAggregator * self,
|
|||
GstPadTemplate * templ, const gchar * req_name, const GstCaps * caps)
|
||||
{
|
||||
GstAggregatorPad *agg_pad;
|
||||
GstElementClass *klass = GST_ELEMENT_GET_CLASS (self);
|
||||
GstAggregatorPrivate *priv = self->priv;
|
||||
|
||||
if (templ == gst_element_class_get_pad_template (klass, "sink_%u")) {
|
||||
gint serial = 0;
|
||||
gchar *name = NULL;
|
||||
|
||||
if (templ->direction != GST_PAD_SINK ||
|
||||
g_strcmp0 (templ->name_template, "sink_%u"))
|
||||
goto not_sink;
|
||||
|
||||
GST_OBJECT_LOCK (self);
|
||||
if (req_name == NULL || strlen (req_name) < 6
|
||||
|| !g_str_has_prefix (req_name, "sink_")) {
|
||||
|
@ -1339,7 +1340,11 @@ gst_aggregator_default_create_new_pad (GstAggregator * self,
|
|||
GST_OBJECT_UNLOCK (self);
|
||||
|
||||
return agg_pad;
|
||||
} else {
|
||||
|
||||
/* errors */
|
||||
not_sink:
|
||||
{
|
||||
GST_WARNING_OBJECT (self, "request new pad that is not a SINK pad\n");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue