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
This commit is contained in:
Thibault Saunier 2016-10-07 15:31:40 +02:00
parent e31b8627ef
commit a2ae8762af
2 changed files with 14 additions and 2 deletions

View file

@ -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;

View file

@ -85,3 +85,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))