From cbff745b49ee8b8ac51bedb41c9990b83b35d24f Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Fri, 4 Jun 2010 19:30:14 +0200 Subject: [PATCH] decodebin2: Handle raw streams we don't want. If a file contains raw streams (not requiring a decoder) that we do not want (expose-all-streams == FALSE), we would previously consider those of unknown-type (missing a decoder) ... whereas in fact it was just because they don't need decoders. This only applies if expose-all-streams is FALSE. --- gst/playback/gstdecodebin2.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index 67d85239cb..300d23e7f1 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -1363,9 +1363,20 @@ analyze_new_pad (GstDecodeBin * dbin, GstElement * src, GstPad * pad, if (factories == NULL) goto expose_pad; - /* if the array is empty, we have an unknown type */ + /* if the array is empty, we have a type for which we have no decoder */ if (factories->n_values == 0) { - /* no compatible factories */ + if (!dbin->expose_allstreams) { + GstCaps *raw = gst_static_caps_get (&default_raw_caps); + + /* If the caps are raw, this just means we don't want to expose them */ + if (gst_caps_can_intersect (raw, caps)) { + gst_caps_unref (raw); + goto discarded_type; + } + gst_caps_unref (raw); + } + + /* if not we have a unhandled type with no compatible factories */ g_value_array_free (factories); gst_object_unref (dpad); goto unknown_type;