clip: Snapping should happen with one and only one TrackElement
authorThibault Saunier <tsaunier@igalia.com>
Sun, 11 Mar 2018 14:13:05 +0000 (11:13 -0300)
committerThibault Saunier <tsaunier@igalia.com>
Sun, 11 Mar 2018 14:24:15 +0000 (11:24 -0300)
This was leading to clip with TrackElements that were not at the
same position in their container, and weird bugs, see:

    https://gitlab.gnome.org/GNOME/pitivi/issues/2133

ges/ges-clip.c

index 539c149..34ac6fa 100644 (file)
@@ -152,10 +152,12 @@ _set_start (GESTimelineElement * element, GstClockTime start)
     if (child != container->initiated_move) {
       /* Make the snapping happen if in a timeline */
       timeline = GES_TIMELINE_ELEMENT_TIMELINE (child);
-      if (timeline == NULL || ges_timeline_move_object_simple (timeline, child,
-              NULL, GES_EDGE_NONE, start) == FALSE)
-        _set_start0 (GES_TIMELINE_ELEMENT (child), start);
+      if (timeline && !container->initiated_move) {
+        if (ges_timeline_move_object_simple (timeline, child, NULL, GES_EDGE_NONE, start))
+          continue;
+      }
 
+      _set_start0 (GES_TIMELINE_ELEMENT (child), start);
     }
   }
   container->children_control_mode = GES_CHILDREN_UPDATE;