summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@gnome.org>2017-11-07 10:15:58 -0300
committerThibault Saunier <tsaunier@gnome.org>2017-11-07 10:18:45 -0300
commitf3dbcd27537d5f94921e88ec6bae9559599654e7 (patch)
tree21cce31634cb5dc5442e88710f1cda811f639a84
parent62891c3f03e3ec87c1fd54e4c04b30e38445db20 (diff)
timeline: Do not snap object within the moving context
Reviewed-by: Alex Băluț <<alexandru.balut@gmail.com>> Differential Revision: https://phabricator.freedesktop.org/D1873
-rw-r--r--ges/ges-auto-transition.c11
-rw-r--r--ges/ges-timeline.c7
2 files changed, 16 insertions, 2 deletions
diff --git a/ges/ges-auto-transition.c b/ges/ges-auto-transition.c
index d52d1c49d7..3267edd4d8 100644
--- a/ges/ges-auto-transition.c
+++ b/ges/ges-auto-transition.c
@@ -169,9 +169,16 @@ ges_auto_transition_new (GESTrackElement * transition,
G_CALLBACK (_track_changed_cb), self);
GST_DEBUG_OBJECT (self, "Created transition %" GST_PTR_FORMAT
- " between %" GST_PTR_FORMAT " and: %" GST_PTR_FORMAT
+ " between %" GST_PTR_FORMAT "[% " GST_TIME_FORMAT
+ " - %" GST_TIME_FORMAT "] and: %" GST_PTR_FORMAT
+ "[% " GST_TIME_FORMAT " - %" GST_TIME_FORMAT "]"
" in layer nb %i, start: %" GST_TIME_FORMAT " duration: %"
- GST_TIME_FORMAT, transition, next_source, previous_source,
+ GST_TIME_FORMAT, transition, previous_source,
+ GST_TIME_ARGS (_START (previous_source)),
+ GST_TIME_ARGS (_END (previous_source)),
+ next_source,
+ GST_TIME_ARGS (_START (next_source)),
+ GST_TIME_ARGS (_END (next_source)),
ges_layer_get_priority (ges_clip_get_layer
(self->previous_clip)),
GST_TIME_ARGS (_START (transition)),
diff --git a/ges/ges-timeline.c b/ges/ges-timeline.c
index 0a9013ab0b..71f5247bd4 100644
--- a/ges/ges-timeline.c
+++ b/ges/ges-timeline.c
@@ -1306,6 +1306,10 @@ ges_timeline_snap_position (GESTimeline * timeline,
if (tmp_container == container)
continue;
+ if (g_hash_table_lookup (priv->movecontext.toplevel_containers,
+ tmp_container))
+ continue;
+
if (timecode > *iter_tc)
diff = timecode - *iter_tc;
else
@@ -1481,11 +1485,14 @@ ges_timeline_set_moving_context (GESTimeline * timeline, GESTrackElement * obj,
return TRUE;
}
+
GST_DEBUG_OBJECT (clip,
"Changing context:\nold: obj: %p, mode: %d, edge: %d \n"
"new: obj: %p, mode: %d, edge: %d ! Has changed %i", mv_ctx->clip,
mv_ctx->mode, mv_ctx->edge, clip, mode, edge, mv_ctx->needs_move_ctx);
+ /* Make sure snapping context is reset when changing the moving context */
+ ges_timeline_emit_snappig (timeline, NULL, NULL);
clean_movecontext (mv_ctx);
mv_ctx->edge = edge;
mv_ctx->mode = mode;