From 36223e25b9f5ceff93076313cf3fb2be81cf49f2 Mon Sep 17 00:00:00 2001 From: Henry Wilkes Date: Thu, 23 Apr 2020 17:30:17 +0100 Subject: [PATCH] layer: don't set timeline when moving clip If a clip is moving we should not unset its timeline when it is removed from the layer. Logic has been moved to ges_timeline_add_clip and ges_timeline_remove_clip. Part-of: --- ges/ges-layer.c | 7 +------ ges/ges-timeline.c | 4 ++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ges/ges-layer.c b/ges/ges-layer.c index 178e7a9743..c46ee97ff9 100644 --- a/ges/ges-layer.c +++ b/ges/ges-layer.c @@ -508,10 +508,8 @@ ges_layer_remove_clip_internal (GESLayer * layer, GESClip * clip, /* inform the clip it's no longer in a layer */ ges_clip_set_layer (clip, NULL); /* so neither in a timeline */ - if (timeline) { + if (timeline) ges_timeline_remove_clip (timeline, clip); - ges_timeline_element_set_timeline (GES_TIMELINE_ELEMENT (clip), NULL); - } for (tmp = GES_CONTAINER_CHILDREN (clip); tmp; tmp = tmp->next) ges_track_element_set_layer_active (tmp->data, TRUE); @@ -780,9 +778,6 @@ ges_layer_add_clip (GESLayer * layer, GESClip * clip) ges_layer_resync_priorities (layer); - ges_timeline_element_set_timeline (GES_TIMELINE_ELEMENT (clip), - layer->timeline); - /* FIXME: ideally we would only emit if we are going to return TRUE. * However, for backward-compatibility, we ensure the "clip-added" * signal is released before the clip's "child-added" signal, which is diff --git a/ges/ges-timeline.c b/ges/ges-timeline.c index 71e90b8c75..a9a9208315 100644 --- a/ges/ges-timeline.c +++ b/ges/ges-timeline.c @@ -1681,6 +1681,8 @@ ges_timeline_add_clip (GESTimeline * timeline, GESClip * clip) /* TODO: extend with GError ** argument, which is accepted by * ges_clip_add_child_to_track */ + ges_timeline_element_set_timeline (GES_TIMELINE_ELEMENT (clip), timeline); + /* We make sure not to be connected twice */ g_signal_handlers_disconnect_by_func (clip, clip_track_element_added_cb, timeline); @@ -1748,6 +1750,8 @@ ges_timeline_remove_clip (GESTimeline * timeline, GESClip * clip) g_signal_handlers_disconnect_by_func (clip, clip_track_element_removed_cb, timeline); + ges_timeline_element_set_timeline (GES_TIMELINE_ELEMENT (clip), NULL); + GST_DEBUG ("Done"); }