diff options
author | Thiago Santos <thiagoss@osg.samsung.com> | 2014-08-11 12:21:28 -0300 |
---|---|---|
committer | Thiago Santos <thiagoss@osg.samsung.com> | 2014-08-11 12:21:28 -0300 |
commit | 7895d8836945706c037e2308a75a3728b3d988db (patch) | |
tree | 867c289c1cefed8044a2c7f030553969af933ff6 /ext/assrender/gstassrender.c | |
parent | eee178988ad2d7ad03163bb59cdf9b4cc79a517d (diff) | |
download | gstreamer-plugins-bad-7895d8836945706c037e2308a75a3728b3d988db.tar.gz |
assrender: always intersect with the filter caps
Avoids returning values that peers can't use
https://bugzilla.gnome.org/show_bug.cgi?id=733916
Diffstat (limited to 'ext/assrender/gstassrender.c')
-rw-r--r-- | ext/assrender/gstassrender.c | 41 |
1 files changed, 14 insertions, 27 deletions
diff --git a/ext/assrender/gstassrender.c b/ext/assrender/gstassrender.c index 369801c97..253d111ab 100644 --- a/ext/assrender/gstassrender.c +++ b/ext/assrender/gstassrender.c @@ -612,13 +612,6 @@ gst_ass_render_get_videosink_caps (GstPad * pad, GstCaps * filter) /* 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 @@ -634,14 +627,13 @@ gst_ass_render_get_videosink_caps (GstPad * pad, GstCaps * filter) } 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); @@ -682,12 +674,6 @@ gst_ass_render_get_src_caps (GstPad * pad, GstCaps * filter) /* if peer returns ANY caps, return filtered sink pad template caps */ caps = gst_caps_copy (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 { @@ -704,14 +690,15 @@ gst_ass_render_get_src_caps (GstPad * pad, GstCaps * filter) } 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); |