mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-22 15:18:21 +00:00
clip: Fix layer managament when copying a clip that was pasted
This commit is contained in:
parent
ded3a5fb2f
commit
3b95bec095
2 changed files with 27 additions and 5 deletions
|
@ -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 *
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue