project: Disable update in the project rather than the formatter

We need to make sure the update are disabled until the project is fully
loaded, let the responsability to the project instead of the formatter
This commit is contained in:
Thibault Saunier 2013-06-12 11:32:16 -04:00
parent 284648e536
commit d702b16e25
2 changed files with 3 additions and 2 deletions

View file

@ -319,10 +319,8 @@ ges_formatter_load_from_uri (GESFormatter * formatter,
g_return_val_if_fail (GES_IS_TIMELINE (timeline), FALSE);
if (klass->load_from_uri) {
ges_timeline_enable_update (timeline, FALSE);
formatter->timeline = timeline;
ret = klass->load_from_uri (formatter, timeline, uri, error);
ges_timeline_enable_update (timeline, TRUE);
}
return ret;

View file

@ -100,6 +100,7 @@ _emit_loaded_in_idle (EmitLoadedInIdle * data)
{
g_signal_emit (data->project, _signals[LOADED_SIGNAL], 0, data->timeline);
ges_timeline_enable_update (data->timeline, TRUE);
gst_object_unref (data->project);
gst_object_unref (data->timeline);
g_slice_free (EmitLoadedInIdle, data);
@ -200,6 +201,7 @@ _load_project (GESProject * project, GESTimeline * timeline, GError ** error)
}
ges_project_add_formatter (GES_PROJECT (project), formatter);
ges_timeline_enable_update (timeline, FALSE);
ges_formatter_load_from_uri (formatter, timeline, priv->uri, &lerr);
if (lerr) {
GST_WARNING_OBJECT (project, "Could not load the timeline,"
@ -515,6 +517,7 @@ ges_project_set_loaded (GESProject * project, GESFormatter * formatter)
/* We are now done with that formatter */
ges_project_remove_formatter (project, formatter);
ges_timeline_enable_update (formatter->timeline, TRUE);
return TRUE;
}