gst/playback/: Post nice/more useful error message if we don't have a decoder for...
authorTim-Philipp Müller <tim@centricular.net>
Tue, 30 Oct 2007 15:54:46 +0000 (15:54 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Tue, 30 Oct 2007 15:54:46 +0000 (15:54 +0000)
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
gst/playback/gstdecodebin.c
gst/playback/gstdecodebin2.c

index c3bc787..e60e3ed 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
        * gst/playback/gstdecodebin2.c: (gst_decode_group_expose):
index b3f4bee..4078e7e 100644 (file)
@@ -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")) {
index 4bdd9a9..56b8ed6 100644 (file)
@@ -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;