ges/ges-simple-timeline-layer.c: also error when transition duration exceeds
authorBrandon Lewis <brandon.lewis@collabora.co.uk>
Thu, 27 May 2010 22:11:51 +0000 (00:11 +0200)
committerEdward Hervey <edward.hervey@collabora.co.uk>
Wed, 9 Jun 2010 09:28:09 +0000 (11:28 +0200)
that of its neighbors

ges/ges-simple-timeline-layer.c

index c00fd8b56c5d919d523eda9120b97c1666705a98..c68d525365fb858b5e7f49fb307cfa9fd236109c 100644 (file)
@@ -110,6 +110,7 @@ gstl_recalculate (GESSimpleTimelineLayer * self)
   for (tmp = self->objects; tmp; tmp = tmp->next) {
     GESTimelineObject *obj = (GESTimelineObject *) tmp->data;
     GST_DEBUG ("%p, %ld", obj, pos);
+    guint64 dur = GES_TIMELINE_OBJECT_DURATION (obj);
 
     if (GES_IS_TIMELINE_SOURCE (obj)) {
       GST_DEBUG ("%p is a source\n", obj);
@@ -123,7 +124,7 @@ gstl_recalculate (GESSimpleTimelineLayer * self)
         ges_timeline_object_set_priority (obj, priority);
       }
 
-      pos += GES_TIMELINE_OBJECT_DURATION (obj);
+      pos += dur;
     } else if (GES_IS_TIMELINE_TRANSITION (obj)) {
       GST_DEBUG ("%p is transition\n", obj);
 
@@ -132,13 +133,23 @@ gstl_recalculate (GESSimpleTimelineLayer * self)
       }
 
       if (GES_IS_TIMELINE_SOURCE (prev_object)) {
-        pos -= GES_TIMELINE_OBJECT_DURATION (obj);
+        pos -= dur;
       }
 
       if (G_UNLIKELY (GES_TIMELINE_OBJECT_PRIORITY (obj) != priority)) {
         ges_timeline_object_set_priority (obj, priority - 1);
       }
 
+      if (GES_TIMELINE_OBJECT_DURATION (prev_object) < dur) {
+        GST_ERROR ("transition duration exceeds that of previous neighbor!");
+      }
+
+      GList *l_next = g_list_next (tmp);
+
+      if (l_next && (GES_TIMELINE_OBJECT_DURATION (l_next->data) < dur)) {
+        GST_ERROR ("trandition duration exceeds that of next neighbor!");
+      }
+
       ges_timeline_object_set_start (obj, pos);
     }