From f3dbcd27537d5f94921e88ec6bae9559599654e7 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Tue, 7 Nov 2017 10:15:58 -0300 Subject: [PATCH] timeline: Do not snap object within the moving context MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Alex Băluț <> Differential Revision: https://phabricator.freedesktop.org/D1873 --- ges/ges-auto-transition.c | 11 +++++++++-- ges/ges-timeline.c | 7 +++++++ 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; -- 2.34.1