better error handling, still needs improvement

Original commit message from CVS:
better error handling, still needs improvement
This commit is contained in:
Thomas Vander Stichele 2002-08-11 19:33:47 +00:00
parent e4056aa180
commit 62deade97d
2 changed files with 12 additions and 2 deletions

View file

@ -106,7 +106,11 @@ gst_pipeline_init (GstPipeline *pipeline)
/* get an instance of the default scheduler */
scheduler = gst_scheduler_factory_make (NULL, GST_ELEMENT (pipeline));
/* FIXME need better error handling */
g_return_if_fail (scheduler != NULL);
if (scheduler == NULL)
{
g_error ("Critical error: could not get a scheduler - \
are you sure you have a registry ?");
}
gst_scheduler_setup (scheduler);
}

View file

@ -810,11 +810,17 @@ GstScheduler*
gst_scheduler_factory_make (const gchar *name, GstElement *parent)
{
GstSchedulerFactory *factory;
const gchar *default_name = gst_scheduler_factory_get_default_name ();
if (name)
factory = gst_scheduler_factory_find (name);
else
factory = gst_scheduler_factory_find (gst_scheduler_factory_get_default_name ());
{
/* FIXME: do better error handling */
if (default_name == NULL)
g_error ("No default scheduler name - do you have a registry ?");
factory = gst_scheduler_factory_find (default_name);
}
if (factory == NULL)
return NULL;