ges_timeline_element_set_start (GESTimelineElement * self, GstClockTime start)
{
GESTimelineElementClass *klass;
+ GESTimelineElement *toplevel_container;
g_return_if_fail (GES_IS_TIMELINE_ELEMENT (self));
" new start: %" GST_TIME_FORMAT,
GST_TIME_ARGS (GES_TIMELINE_ELEMENT_START (self)), GST_TIME_ARGS (start));
+ toplevel_container = ges_timeline_element_get_toplevel_parent (self);
+
+ if (((gint64) (_START (toplevel_container) + start - _START (self))) < 0) {
+ GST_INFO_OBJECT (self, "Can not move the object as it would imply its"
+ "container to have a negative start value");
+
+ gst_object_unref (toplevel_container);
+ return;
+ }
+
+ gst_object_unref (toplevel_container);
if (klass->set_start) {
if (klass->set_start (self, start)) {
self->start = start;
ASSERT_OBJECT_REFCOUNT (group, "1 ref for the timeline", 1);
fail_unless (g_list_length (GES_CONTAINER_CHILDREN (group)) == 3);
assert_equals_int (GES_CONTAINER_HEIGHT (group), 2);
+
+ /* Nothing should move */
+ ges_timeline_element_set_start (GES_TIMELINE_ELEMENT (clip1), 5);
+
CHECK_OBJECT_PROPS (clip, 0, 0, 10);
CHECK_OBJECT_PROPS (clip1, 10, 0, 10);
CHECK_OBJECT_PROPS (clip2, 50, 0, 60);