decodebin2: avoid assertion failure on empty/NULL caps

This commit is contained in:
Mark Nauwelaerts 2009-08-05 15:36:30 +02:00
parent 3b4c35e319
commit 188d698449

View file

@ -1118,13 +1118,19 @@ unknown_type:
if (src == dbin->typefind) { if (src == dbin->typefind) {
gchar *desc; gchar *desc;
desc = gst_pb_utils_get_decoder_description (caps); if (caps && !gst_caps_is_empty (caps)) {
GST_ELEMENT_ERROR (dbin, STREAM, CODEC_NOT_FOUND, desc = gst_pb_utils_get_decoder_description (caps);
(_("A %s plugin is required to play this stream, but not installed."), GST_ELEMENT_ERROR (dbin, STREAM, CODEC_NOT_FOUND,
desc), (_("A %s plugin is required to play this stream, "
("No decoder to handle media type '%s'", "but not installed."), desc),
gst_structure_get_name (gst_caps_get_structure (caps, 0)))); ("No decoder to handle media type '%s'",
g_free (desc); gst_structure_get_name (gst_caps_get_structure (caps, 0))));
g_free (desc);
} else {
GST_ELEMENT_ERROR (dbin, STREAM, TYPE_NOT_FOUND,
(_("Could not determine type of stream")),
("Stream caps %" GST_PTR_FORMAT, caps));
}
} }
gst_element_post_message (GST_ELEMENT_CAST (dbin), gst_element_post_message (GST_ELEMENT_CAST (dbin),