gst/playback/: Post nice/more useful error message if we don't have a decoder for the primary type.

Original commit message from CVS:
* gst/playback/gstdecodebin.c: (close_pad_link), (type_found):
* gst/playback/gstdecodebin2.c: (analyze_new_pad):
Post nice/more useful error message if we don't have a decoder for
the primary type.
This commit is contained in:
Tim-Philipp Müller 2007-10-30 15:54:46 +00:00
parent b55c61c933
commit 4c0e44de0f
3 changed files with 33 additions and 1 deletions

View file

@ -1,3 +1,10 @@
2007-10-30 Tim-Philipp Müller <tim at centricular dot net>
* gst/playback/gstdecodebin.c: (close_pad_link), (type_found):
* gst/playback/gstdecodebin2.c: (analyze_new_pad):
Post nice/more useful error message if we don't have a decoder for
the primary type.
2007-10-30 Wim Taymans <wim.taymans@gmail.com> 2007-10-30 Wim Taymans <wim.taymans@gmail.com>
* gst/playback/gstdecodebin2.c: (gst_decode_group_expose): * gst/playback/gstdecodebin2.c: (gst_decode_group_expose):

View file

@ -780,6 +780,19 @@ unknown_type:
gst_element_post_message (GST_ELEMENT_CAST (decode_bin), gst_element_post_message (GST_ELEMENT_CAST (decode_bin),
gst_missing_decoder_message_new (GST_ELEMENT_CAST (decode_bin), caps)); gst_missing_decoder_message_new (GST_ELEMENT_CAST (decode_bin), caps));
if (element == decode_bin->typefind) {
gchar *desc;
desc = gst_pb_utils_get_decoder_description (caps);
GST_ELEMENT_ERROR (decode_bin, STREAM, CODEC_NOT_FOUND,
(_("A %s plugin is required to play this stream, but not installed."),
desc),
("No decoder to handle media type '%s'",
gst_structure_get_name (gst_caps_get_structure (caps, 0))));
g_free (desc);
}
return; return;
} }
dont_know_yet: dont_know_yet:
@ -1558,7 +1571,7 @@ type_found (GstElement * typefind, guint probability, GstCaps * caps,
decode_bin->have_type = TRUE; decode_bin->have_type = TRUE;
/* special-case text/plain: we only want to accept it as a raw type if it /* special-case text/plain: we only want to accept it as a raw type if it
* comes from a subtitel parser element or a demuxer, but not if it is the * comes from a subtitle parser element or a demuxer, but not if it is the
* type of the entire stream, in which case we just want to error out */ * type of the entire stream, in which case we just want to error out */
if (typefind == decode_bin->typefind && if (typefind == decode_bin->typefind &&
gst_structure_has_name (gst_caps_get_structure (caps, 0), "text/plain")) { gst_structure_has_name (gst_caps_get_structure (caps, 0), "text/plain")) {

View file

@ -902,6 +902,18 @@ unknown_type:
if (dbin->groups == NULL) if (dbin->groups == NULL)
remove_fakesink (dbin); remove_fakesink (dbin);
if (src == dbin->typefind) {
gchar *desc;
desc = gst_pb_utils_get_decoder_description (caps);
GST_ELEMENT_ERROR (dbin, STREAM, CODEC_NOT_FOUND,
(_("A %s plugin is required to play this stream, but not installed."),
desc),
("No decoder to handle media type '%s'",
gst_structure_get_name (gst_caps_get_structure (caps, 0))));
g_free (desc);
}
gst_element_post_message (GST_ELEMENT_CAST (dbin), gst_element_post_message (GST_ELEMENT_CAST (dbin),
gst_missing_decoder_message_new (GST_ELEMENT_CAST (dbin), caps)); gst_missing_decoder_message_new (GST_ELEMENT_CAST (dbin), caps));
return; return;