discoverer: Get pad caps if we can't get negotiated caps

Better provide something than nothing

https://bugzilla.gnome.org/show_bug.cgi?id=632988
This commit is contained in:
Edward Hervey 2010-10-24 16:09:26 +02:00
parent da9682a593
commit 65cfcffbc0

View file

@ -508,14 +508,17 @@ collect_stream_information (GstDiscoverer * dc, PrivateStream * ps, guint idx)
/* Get caps */
caps = gst_pad_get_negotiated_caps (ps->pad);
if (!caps) {
GST_WARNING ("Couldn't get negotiated caps from %s:%s",
GST_DEBUG_PAD_NAME (ps->pad));
caps = gst_pad_get_caps (ps->pad);
}
if (caps) {
GST_DEBUG ("Got caps %" GST_PTR_FORMAT, caps);
gst_structure_id_set (st, _CAPS_QUARK, GST_TYPE_CAPS, caps, NULL);
gst_caps_unref (caps);
} else
GST_WARNING ("Couldn't get negotiated caps from %s:%s",
GST_DEBUG_PAD_NAME (ps->pad));
}
if (ps->tags)
gst_structure_id_set (st, _TAGS_QUARK, GST_TYPE_STRUCTURE, ps->tags, NULL);