ges: Raise an error when the discoverer returns != RESULT_OK

And do not try to run the pipeline when that happens
This commit is contained in:
Thibault Saunier 2015-06-09 21:00:44 +02:00
parent 4f83cde172
commit 321d2c2edd
2 changed files with 9 additions and 3 deletions

View file

@ -354,8 +354,14 @@ discoverer_discovered_cb (GstDiscoverer * discoverer,
if (tags)
gst_tag_list_foreach (tags, (GstTagForeachFunc) _set_meta_foreach, mfs);
if (err == NULL)
if (gst_discoverer_info_get_result (info) == GST_DISCOVERER_OK) {
ges_uri_clip_asset_set_info (mfs, info);
} else if (!err) {
err = g_error_new (GST_RESOURCE_ERROR, GST_RESOURCE_ERROR_FAILED,
"Stream %s discovering failed (error code: %d)",
uri, gst_discoverer_info_get_result (info));
}
ges_asset_cache_set_loaded (GES_TYPE_URI_CLIP, uri, err);
}

View file

@ -183,8 +183,8 @@ _project_loaded_cb (GESProject * project, GESTimeline * timeline,
g_application_quit (G_APPLICATION (self));
}
if (opts->needs_set_state
&& gst_element_set_state (GST_ELEMENT (self->priv->pipeline),
if (!self->priv->seenerrors && opts->needs_set_state &&
gst_element_set_state (GST_ELEMENT (self->priv->pipeline),
GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE) {
g_error ("Failed to start the pipeline\n");
}