From 4c0e44de0ffd693bdfd488f2c6cc36f8c0565f5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 30 Oct 2007 15:54:46 +0000 Subject: [PATCH] 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. --- ChangeLog | 7 +++++++ gst/playback/gstdecodebin.c | 15 ++++++++++++++- gst/playback/gstdecodebin2.c | 12 ++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c3bc7876ff..e60e3ed819 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-10-30 Tim-Philipp Müller + + * 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 * gst/playback/gstdecodebin2.c: (gst_decode_group_expose): diff --git a/gst/playback/gstdecodebin.c b/gst/playback/gstdecodebin.c index b3f4bee804..4078e7e6e4 100644 --- a/gst/playback/gstdecodebin.c +++ b/gst/playback/gstdecodebin.c @@ -780,6 +780,19 @@ unknown_type: gst_element_post_message (GST_ELEMENT_CAST (decode_bin), 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; } dont_know_yet: @@ -1558,7 +1571,7 @@ type_found (GstElement * typefind, guint probability, GstCaps * caps, decode_bin->have_type = TRUE; /* 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 */ if (typefind == decode_bin->typefind && gst_structure_has_name (gst_caps_get_structure (caps, 0), "text/plain")) { diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index 4bdd9a9bb8..56b8ed6f1e 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -902,6 +902,18 @@ unknown_type: if (dbin->groups == NULL) 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_missing_decoder_message_new (GST_ELEMENT_CAST (dbin), caps)); return;