diff --git a/ext/pango/gstbasetextoverlay.c b/ext/pango/gstbasetextoverlay.c index 60c5eb266d..30888272f9 100644 --- a/ext/pango/gstbasetextoverlay.c +++ b/ext/pango/gstbasetextoverlay.c @@ -1187,16 +1187,8 @@ gst_base_text_overlay_get_videosink_caps (GstPad * pad, GST_DEBUG_OBJECT (pad, "peer caps %" GST_PTR_FORMAT, peer_caps); if (gst_caps_is_any (peer_caps)) { - /* if peer returns ANY caps, return filtered src pad template caps */ caps = gst_caps_copy (gst_pad_get_pad_template_caps (srcpad)); - if (filter) { - GstCaps *intersection = gst_caps_intersect_full (filter, caps, - GST_CAPS_INTERSECT_FIRST); - gst_caps_unref (caps); - caps = intersection; - } - } else { /* duplicate caps which contains the composition into one version with @@ -1212,14 +1204,13 @@ gst_base_text_overlay_get_videosink_caps (GstPad * pad, } else { /* no peer, our padtemplate is enough then */ caps = gst_pad_get_pad_template_caps (pad); - if (filter) { - GstCaps *intersection; + } - intersection = - gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST); - gst_caps_unref (caps); - caps = intersection; - } + if (filter) { + GstCaps *intersection = gst_caps_intersect_full (filter, caps, + GST_CAPS_INTERSECT_FIRST); + gst_caps_unref (caps); + caps = intersection; } GST_DEBUG_OBJECT (overlay, "returning %" GST_PTR_FORMAT, caps);