mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +00:00
better error handling, still needs improvement
Original commit message from CVS: better error handling, still needs improvement
This commit is contained in:
parent
e4056aa180
commit
62deade97d
2 changed files with 12 additions and 2 deletions
|
@ -106,7 +106,11 @@ gst_pipeline_init (GstPipeline *pipeline)
|
||||||
/* get an instance of the default scheduler */
|
/* get an instance of the default scheduler */
|
||||||
scheduler = gst_scheduler_factory_make (NULL, GST_ELEMENT (pipeline));
|
scheduler = gst_scheduler_factory_make (NULL, GST_ELEMENT (pipeline));
|
||||||
/* FIXME need better error handling */
|
/* 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);
|
gst_scheduler_setup (scheduler);
|
||||||
}
|
}
|
||||||
|
|
|
@ -810,11 +810,17 @@ GstScheduler*
|
||||||
gst_scheduler_factory_make (const gchar *name, GstElement *parent)
|
gst_scheduler_factory_make (const gchar *name, GstElement *parent)
|
||||||
{
|
{
|
||||||
GstSchedulerFactory *factory;
|
GstSchedulerFactory *factory;
|
||||||
|
const gchar *default_name = gst_scheduler_factory_get_default_name ();
|
||||||
|
|
||||||
if (name)
|
if (name)
|
||||||
factory = gst_scheduler_factory_find (name);
|
factory = gst_scheduler_factory_find (name);
|
||||||
else
|
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)
|
if (factory == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in a new issue