clip: Fix layer managament when copying a clip that was pasted

This commit is contained in:
Thibault Saunier 2019-05-25 18:51:08 -04:00 committed by Thibault Saunier
parent ded3a5fb2f
commit 3b95bec095
2 changed files with 27 additions and 5 deletions

View file

@ -621,16 +621,16 @@ _deep_copy (GESTimelineElement * element, GESTimelineElement * copy)
GList *tmp;
GESClip *self = GES_CLIP (element), *ccopy = GES_CLIP (copy);
if (!self->priv->layer)
return;
for (tmp = GES_CONTAINER_CHILDREN (element); tmp; tmp = tmp->next) {
ccopy->priv->copied_track_elements =
g_list_append (ccopy->priv->copied_track_elements,
ges_timeline_element_copy (tmp->data, TRUE));
}
if (self->priv->copied_layer)
ccopy->priv->copied_layer = g_object_ref (self->priv->copied_layer);
else if (self->priv->layer)
ccopy->priv->copied_layer = g_object_ref (self->priv->layer);
ccopy->priv->copied_layer = g_object_ref (self->priv->layer);
}
static GESTimelineElement *

View file

@ -691,7 +691,7 @@ class TestInvalidOverlaps(common.GESSimpleTimelineTest):
]
])
copy = clip.copy(True)
self.assertIsNotNone(copy.paste(copy.props.start + 1))
pasted = copy.paste(copy.props.start + 1)
self.assertTimelineTopology([
[
(GES.TestClip, 0, 10),
@ -699,6 +699,28 @@ class TestInvalidOverlaps(common.GESSimpleTimelineTest):
]
])
pasted.move_to_layer(self.timeline.append_layer())
self.assertTimelineTopology([
[
(GES.TestClip, 0, 10),
],
[
(GES.TestClip, 1, 10),
]
])
copy = pasted.copy(True)
self.assertIsNotNone(copy.paste(pasted.props.start - 1))
self.assertTimelineTopology([
[
(GES.TestClip, 0, 10),
],
[
(GES.TestClip, 0, 10),
(GES.TestClip, 1, 10),
],
])
def test_move_group_with_overlaping_clips(self):
self.track_types = [GES.TrackType.AUDIO]
super().setUp()