summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <thibault.saunier@osg.samsung.com>2016-10-07 15:31:40 +0200
committerThibault Saunier <thibault.saunier@osg.samsung.com>2016-11-17 07:51:31 -0300
commitdcc5e97a90ecc49751945bfe010551e5e911a26f (patch)
tree0411866e78865b924a9d51213bf26b99da78f4cc
parent52a022ae8316e58a7446af5bbf8c64ed132748df (diff)
timeline: Make sure transitions between rippled clips are never deleted
Reviewed-by: Alex Băluț <alexandru.balut@gmail.com> Differential Revision: https://phabricator.freedesktop.org/D1361
-rw-r--r--ges/ges-timeline.c6
-rw-r--r--tests/check/python/test_timeline.py10
2 files changed, 14 insertions, 2 deletions
diff --git a/ges/ges-timeline.c b/ges/ges-timeline.c
index a6e8a7af..30dae414 100644
--- a/ges/ges-timeline.c
+++ b/ges/ges-timeline.c
@@ -838,11 +838,13 @@ _destroy_auto_transition_cb (GESAutoTransition * auto_transition,
get_toplevel_container (auto_transition->previous_clip), *toplevel_next =
get_toplevel_container (auto_transition->next_clip);
- if (mv_ctx->moving_to_layer &&
- g_hash_table_lookup (mv_ctx->toplevel_containers, toplevel_prev) &&
+ if (g_hash_table_lookup (mv_ctx->toplevel_containers, toplevel_prev) &&
g_hash_table_lookup (mv_ctx->toplevel_containers, toplevel_next)) {
GESLayer *nlayer = mv_ctx->moving_to_layer;
+ if (!nlayer)
+ return;
+
ges_clip_move_to_layer (transition, nlayer);
return;
diff --git a/tests/check/python/test_timeline.py b/tests/check/python/test_timeline.py
index 34dc38d6..789f666c 100644
--- a/tests/check/python/test_timeline.py
+++ b/tests/check/python/test_timeline.py
@@ -86,3 +86,13 @@ class TestEditing(common.GESSimpleTimelineTest):
clip1.edit([], layer2.get_priority(), GES.EditMode.EDIT_RIPPLE, GES.Edge.EDGE_NONE, clip1.props.start)
self.assertEquals(self.layer.get_clips(), [])
self.assertEquals(set(layer2.get_clips()), set(all_clips))
+
+ def test_transition_rippling_after_next_clip_stays(self):
+ self.timeline.props.auto_transition = True
+ clip1 = self.add_clip(0, 0, 100)
+ clip2 = self.add_clip(50, 0, 100)
+ all_clips = self.layer.get_clips()
+ self.assertEquals(len(all_clips), 4)
+
+ clip1.edit([], self.layer.get_priority(), GES.EditMode.EDIT_RIPPLE, GES.Edge.EDGE_NONE, clip2.props.start +1)
+ self.assertEquals(set(self.layer.get_clips()), set(all_clips))