From cb02c15d57c89bda305536a4daf77a4ae5c81503 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Mon, 18 May 2020 08:49:53 -0400 Subject: [PATCH] ges: Ensure that assets are added to project before adding clip to timeline It is the right ordering and in Pitivi we set the project size when adding the first (relevant) asset, meaning that our code to reposition clips would kick in (in the unit tests) if we do not respect that ordering. Part-of: --- ges/ges-timeline.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ges/ges-timeline.c b/ges/ges-timeline.c index 9bf8767..d5ad187 100644 --- a/ges/ges-timeline.c +++ b/ges/ges-timeline.c @@ -1734,6 +1734,12 @@ ges_timeline_add_clip (GESTimeline * timeline, GESClip * clip) g_signal_connect (clip, "child-removed", G_CALLBACK (clip_track_element_removed_cb), timeline); + GST_DEBUG ("Making sure that the asset is in our project"); + project = + GES_PROJECT (ges_extractable_get_asset (GES_EXTRACTABLE (timeline))); + ges_project_add_asset (project, + ges_extractable_get_asset (GES_EXTRACTABLE (clip))); + if (ges_clip_is_moving_from_layer (clip)) { GST_DEBUG ("Clip %p moving from one layer to another, not creating " "TrackElement", clip); @@ -1743,12 +1749,6 @@ ges_timeline_add_clip (GESTimeline * timeline, GESClip * clip) ret = add_object_to_tracks (timeline, clip, NULL); } - GST_DEBUG ("Making sure that the asset is in our project"); - project = - GES_PROJECT (ges_extractable_get_asset (GES_EXTRACTABLE (timeline))); - ges_project_add_asset (project, - ges_extractable_get_asset (GES_EXTRACTABLE (clip))); - GST_DEBUG ("Done"); return ret; -- 2.7.4