summaryrefslogtreecommitdiff
path: root/gst/dvbsuboverlay/gstdvbsuboverlay.c
diff options
context:
space:
mode:
authorThiago Santos <thiagoss@osg.samsung.com>2014-08-11 11:33:28 -0300
committerThiago Santos <thiagoss@osg.samsung.com>2014-08-11 11:33:28 -0300
commit627b6ac4617b370bb71012cced10c71672265eba (patch)
tree465b3e2be1254418c761d827d89850e60c512737 /gst/dvbsuboverlay/gstdvbsuboverlay.c
parent44e84025d7d004276bb53a5485442ff9734dcfd2 (diff)
downloadgstreamer-plugins-bad-627b6ac4617b370bb71012cced10c71672265eba.tar.gz
dvbsuboverlay: always intersect with the filter in getcaps
Avoids returning unsupported caps to peers https://bugzilla.gnome.org/show_bug.cgi?id=733916
Diffstat (limited to 'gst/dvbsuboverlay/gstdvbsuboverlay.c')
-rw-r--r--gst/dvbsuboverlay/gstdvbsuboverlay.c41
1 files changed, 14 insertions, 27 deletions
diff --git a/gst/dvbsuboverlay/gstdvbsuboverlay.c b/gst/dvbsuboverlay/gstdvbsuboverlay.c
index de6508478..2f3626960 100644
--- a/gst/dvbsuboverlay/gstdvbsuboverlay.c
+++ b/gst/dvbsuboverlay/gstdvbsuboverlay.c
@@ -550,12 +550,6 @@ gst_dvbsub_overlay_get_videosink_caps (GstDVBSubOverlay * render, GstPad * pad,
/* if peer returns ANY caps, return filtered src pad template caps */
caps = 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 {
@@ -572,14 +566,15 @@ gst_dvbsub_overlay_get_videosink_caps (GstDVBSubOverlay * render, 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;
+
+ intersection =
+ gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST);
+ gst_caps_unref (caps);
+ caps = intersection;
}
GST_DEBUG_OBJECT (render, "returning %" GST_PTR_FORMAT, caps);
@@ -618,13 +613,6 @@ gst_dvbsub_overlay_get_src_caps (GstDVBSubOverlay * render, GstPad * pad,
/* if peer returns ANY caps, return filtered sink pad template caps */
caps = gst_pad_get_pad_template_caps (sinkpad);
- if (filter) {
- GstCaps *intersection = gst_caps_intersect_full (filter, caps,
- GST_CAPS_INTERSECT_FIRST);
- gst_caps_unref (caps);
- caps = intersection;
- }
-
} else {
/* return upstream caps + composition feature + upstream caps
@@ -640,14 +628,13 @@ gst_dvbsub_overlay_get_src_caps (GstDVBSubOverlay * render, 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 (render, "returning %" GST_PTR_FORMAT, caps);