timeline_remove_element (GESTimeline *timeline,
GESTimelineElement *element);
+G_GNUC_INTERNAL
+void
+timeline_fill_gaps (GESTimeline *timeline);
+
+G_GNUC_INTERNAL
+void
+track_resort_and_fill_gaps (GESTrack *track);
+
G_GNUC_INTERNAL void
ges_asset_cache_init (void);
ges_project_set_loaded (GESProject * project, GESFormatter * formatter)
{
GST_INFO_OBJECT (project, "Emit project loaded");
- ges_timeline_commit (formatter->timeline);
+ if (GST_STATE (formatter->timeline) < GST_STATE_PAUSED) {
+ timeline_fill_gaps (formatter->timeline);
+ } else {
+ ges_timeline_commit (formatter->timeline);
+ }
+
g_signal_emit (project, _signals[LOADED_SIGNAL], 0, formatter->timeline);
/* We are now done with that formatter */
return g_hash_table_remove (timeline->priv->all_elements, element->name);
}
+void
+timeline_fill_gaps (GESTimeline * timeline)
+{
+ GList *tmp;
+
+ for (tmp = timeline->tracks; tmp; tmp = tmp->next) {
+ track_resort_and_fill_gaps (tmp->data);
+ }
+}
+
/**** API *****/
/**
* ges_timeline_new:
g_list_free_full (gaps, (GDestroyNotify) free_gap);
}
-static inline void
-resort_and_fill_gaps (GESTrack * track)
+void
+track_resort_and_fill_gaps (GESTrack * track)
{
g_sequence_sort (track->priv->trackelements_by_start,
(GCompareDataFunc) element_start_compare, NULL);
GST_DEBUG ("track:%p, timeline:%p", track, timeline);
track->priv->timeline = timeline;
- resort_and_fill_gaps (track);
+ track_resort_and_fill_gaps (track);
}
/**
it = g_hash_table_lookup (priv->trackelements_iter, object);
g_sequence_remove (it);
- resort_and_fill_gaps (track);
+ track_resort_and_fill_gaps (track);
if (remove_object_internal (track, object) == TRUE) {
ges_timeline_element_set_timeline (GES_TIMELINE_ELEMENT (object), NULL);
{
g_return_val_if_fail (GES_IS_TRACK (track), FALSE);
- resort_and_fill_gaps (track);
+ track_resort_and_fill_gaps (track);
return nle_object_commit (NLE_OBJECT (track->priv->composition), TRUE);
}