summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2014-06-22 20:42:13 +0200
committerSebastian Dröge <sebastian@centricular.com>2014-06-22 20:42:43 +0200
commit9d33b3896968db2abfc5d2cbca8196db09f6bcd5 (patch)
tree6c3886d0f574b5f2416ec59d2bc560b909be946d
parent78317be45d91b7c0086ee3259d2383ccc5d84fae (diff)
playsinkconvertbin: Filter out ANY capsfeatures from the converter caps
We can't convert to ANY capsfeatures, they are only there so that we can passthrough whatever downstream can support... but we definitely don't want to return them to upstream.
-rw-r--r--gst/playback/gstplaysinkconvertbin.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/gst/playback/gstplaysinkconvertbin.c b/gst/playback/gstplaysinkconvertbin.c
index 4eb998d29..8ec85a42d 100644
--- a/gst/playback/gstplaysinkconvertbin.c
+++ b/gst/playback/gstplaysinkconvertbin.c
@@ -394,8 +394,30 @@ gst_play_sink_convert_bin_getcaps (GstPad * pad, GstCaps * filter)
gst_object_unref (peer);
if (self->converter_caps && is_raw_caps (peer_caps, self->audio)) {
GstCaps *converter_caps = gst_caps_ref (self->converter_caps);
+ GstCapsFeatures *cf;
+ GstStructure *s;
+ guint i, n;
+
GST_PLAY_SINK_CONVERT_BIN_FILTER_CAPS (filter, converter_caps);
- ret = gst_caps_merge (peer_caps, converter_caps);
+
+ ret = gst_caps_make_writable (peer_caps);
+
+ /* Filter out ANY capsfeatures from the converter caps. We can't
+ * convert to ANY capsfeatures, they are only there so that we
+ * can passthrough whatever downstream can support... but we
+ * definitely don't want to return them here
+ */
+ n = gst_caps_get_size (converter_caps);
+ for (i = 0; i < n; i++) {
+ s = gst_caps_get_structure (converter_caps, i);
+ cf = gst_caps_get_features (converter_caps, i);
+
+ if (cf && gst_caps_features_is_any (cf))
+ continue;
+ ret =
+ gst_caps_merge_structure_full (ret, gst_structure_copy (s),
+ (cf ? gst_caps_features_copy (cf) : NULL));
+ }
} else {
ret = peer_caps;
GST_PLAY_SINK_CONVERT_BIN_FILTER_CAPS (filter, ret);