ges/ges-simple-timeline-layer.c: print a warning when transitions overlap
authorBrandon Lewis <brandon@collabora.co.uk>
Fri, 4 Jun 2010 17:53:35 +0000 (19:53 +0200)
committerEdward Hervey <edward.hervey@collabora.co.uk>
Wed, 9 Jun 2010 09:28:46 +0000 (11:28 +0200)
ges/ges-simple-timeline-layer.c

index b14ed23f2e9b90c7135bbfe6eb40e9d881aaa370..cdd767d66fe322b801f9685ef905ae42c3189017 100644 (file)
@@ -111,6 +111,7 @@ gstl_recalculate (GESSimpleTimelineLayer * self)
   GstClockTime pos = 0;
   gint priority = GES_TIMELINE_LAYER (self)->min_gnl_priority;
   GESTimelineObject *prev_object = NULL;
+  GESTimelineObject *prev_transition = NULL;
 
   GST_DEBUG ("recalculating values");
 
@@ -154,10 +155,24 @@ gstl_recalculate (GESSimpleTimelineLayer * self)
       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!");
+        GST_ERROR ("transition duration exceeds that of next neighbor!");
       }
 
       ges_timeline_object_set_start (obj, pos);
+
+      if (prev_transition) {
+        guint64 start, end;
+        end = (GES_TIMELINE_OBJECT_DURATION (prev_transition) +
+            GES_TIMELINE_OBJECT_START (prev_transition));
+
+        start = GES_TIMELINE_OBJECT_START (obj);
+
+        if (end > start)
+          GST_ERROR ("%d, %d: overlapping transitions!", start, end);
+      }
+
+      prev_transition = obj;
+
     }
 
     GST_DEBUG (", %ld\n", pos);