discoverer: don't change result for missing plugin errors
authorJonathan Matthew <jonathan@d14n.org>
Wed, 29 Feb 2012 11:25:24 +0000 (21:25 +1000)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Sat, 3 Mar 2012 13:50:34 +0000 (13:50 +0000)
https://bugzilla.gnome.org/show_bug.cgi?id=671047

gst-libs/gst/pbutils/gstdiscoverer.c

index ba02cdb..3486656 100644 (file)
@@ -1158,8 +1158,15 @@ handle_message (GstDiscoverer * dc, GstMessage * msg)
       /* We need to stop */
       done = TRUE;
 
-      GST_DEBUG ("Setting result to ERROR");
-      dc->priv->current_info->result = GST_DISCOVERER_ERROR;
+      /* Don't override missing plugin result code for missing plugin errors */
+      if (dc->priv->current_info->result != GST_DISCOVERER_MISSING_PLUGINS ||
+          (!g_error_matches (gerr, GST_CORE_ERROR,
+                  GST_CORE_ERROR_MISSING_PLUGIN) &&
+              !g_error_matches (gerr, GST_STREAM_ERROR,
+                  GST_STREAM_ERROR_CODEC_NOT_FOUND))) {
+        GST_DEBUG ("Setting result to ERROR");
+        dc->priv->current_info->result = GST_DISCOVERER_ERROR;
+      }
     }
       break;