gst/gsterror.c: Add another error string used in a few existing plugins.
authorMichael Smith <msmith@xiph.org>
Tue, 4 Oct 2005 11:10:04 +0000 (11:10 +0000)
committerMichael Smith <msmith@xiph.org>
Tue, 4 Oct 2005 11:10:04 +0000 (11:10 +0000)
Original commit message from CVS:
* gst/gsterror.c: (_gst_stream_errors_init):
Add another error string used in a few existing plugins.

* gst/gstplugin.c:
* gst/gstpluginfeature.c: (gst_plugin_feature_load):
* tools/gst-inspect.c: (print_element_info):
When a feature disappears from a plugin (and the feature exists in
the cached registry file), things went horribly wrong. This isn't a
complete fix, we should actually be removing the 'missing' features
from the features list when we load the actual plugin. That's not
yet implemented.

gst/gsterror.c
gst/gstplugin.c
gst/gstpluginfeature.c
tools/gst-inspect.c

index 9ccdd3a..1b4f1cc 100644 (file)
@@ -161,6 +161,7 @@ _gst_stream_errors_init (void)
   TABLE (t, STREAM, DEMUX, N_("Could not demultiplex stream."));
   TABLE (t, STREAM, MUX, N_("Could not multiplex stream."));
   TABLE (t, STREAM, FORMAT, N_("Stream is of the wrong format."));
+  TABLE (t, STREAM, STOPPED, N_("Streaming stopped."));
 
   return t;
 }
index 1066447..57fd70e 100644 (file)
@@ -846,7 +846,7 @@ gst_plugin_find_feature_by_name (GstPlugin * plugin, const gchar * name)
  *
  * Load the named plugin. Refs the plugin.
  *
- * Returns: whether the plugin was loaded or not
+ * Returns: A reference to a loaded plugin, or NULL on error.
  */
 GstPlugin *
 gst_plugin_load_by_name (const gchar * name)
index ac5a278..78b4734 100644 (file)
@@ -118,9 +118,13 @@ gst_plugin_feature_load (GstPluginFeature * feature)
       gst_registry_lookup_feature (gst_registry_get_default (), feature->name);
 
   if (real_feature == NULL) {
-    g_critical
+    GST_INFO
         ("Loaded plugin containing feature '%s', but feature disappeared.",
         feature->name);
+  } else if (!real_feature->loaded) {
+    GST_INFO ("Tried to load plugin containing feature '%s', but feature was "
+        "not found.", real_feature->name);
+    return NULL;
   }
 
   return real_feature;
index 0088189..2baa23c 100644 (file)
@@ -1033,6 +1033,11 @@ print_element_info (GstElementFactory * factory, gboolean print_names)
       GST_ELEMENT_FACTORY (gst_plugin_feature_load (GST_PLUGIN_FEATURE
           (factory)));
 
+  if (!factory) {
+    g_print ("element plugin couldn't be loaded\n");
+    return -1;
+  }
+
   element = gst_element_factory_create (factory, NULL);
   if (!element) {
     g_print ("couldn't construct element for some reason\n");