layer is also invalid when there are transitoins at the beginning/end
authorBrandon Lewis <brandon@collabora.co.uk>
Thu, 5 Aug 2010 13:46:02 +0000 (15:46 +0200)
committerEdward Hervey <edward.hervey@collabora.co.uk>
Thu, 2 Sep 2010 16:08:43 +0000 (18:08 +0200)
ges/ges-simple-timeline-layer.c
tests/check/ges/simplelayer.c

index 19a8a29..31099b4 100644 (file)
@@ -175,6 +175,10 @@ gstl_recalculate (GESSimpleTimelineLayer * self)
 
   GST_DEBUG ("recalculating values");
 
+  if (self->objects && GES_IS_TIMELINE_TRANSITION (self->objects->data)) {
+    valid = FALSE;
+  }
+
   for (tmp = self->objects; tmp; tmp = tmp->next) {
     GESTimelineObject *obj;
     guint64 dur;
@@ -256,6 +260,10 @@ gstl_recalculate (GESSimpleTimelineLayer * self)
 
   }
 
+  if (prev_object && GES_IS_TIMELINE_TRANSITION (prev_object)) {
+    valid = FALSE;
+  }
+
   GST_DEBUG ("Finished recalculating: final start pos is: " GST_TIME_FORMAT,
       GST_TIME_ARGS (pos));
 
index 59afaf1..a739b72 100644 (file)
@@ -427,17 +427,17 @@ GST_START_TEST (test_gsl_with_transitions)
   fail_unless (ges_simple_timeline_layer_add_object (gstl,
           GES_TIMELINE_OBJECT (tr3), 5));
 
+  /* at this point the layer should still be valid */
+  g_object_get (G_OBJECT (layer), "valid", &valid, NULL);
+  fail_unless (valid);
+  fail_unless_equals_int (count, 3);
+
   fail_unless (ges_simple_timeline_layer_add_object (gstl,
           GES_TIMELINE_OBJECT (tr4), -1));
 
   fail_unless (ges_simple_timeline_layer_add_object (gstl,
           GES_TIMELINE_OBJECT (tr5), 0));
 
-  /* at this point the layer should still be valid */
-  g_object_get (G_OBJECT (layer), "valid", &valid, NULL);
-  fail_unless (valid);
-  fail_unless_equals_int (count, 1);
-
   /* removals which result in two or more adjacent transitions will also
    * print a warning on the console. This is expected */
 
@@ -446,11 +446,11 @@ GST_START_TEST (test_gsl_with_transitions)
   fail_unless (ges_timeline_layer_remove_object (layer,
           GES_TIMELINE_OBJECT (source1)));
 
-  /* transition should now be invalid */
+  /* layer should now be invalid */
 
   g_object_get (G_OBJECT (layer), "valid", &valid, NULL);
   fail_unless (!valid);
-  fail_unless_equals_int (count, 2)
+  fail_unless_equals_int (count, 4)
 
       fail_unless (ges_timeline_layer_remove_object (layer,
           GES_TIMELINE_OBJECT (source2)));
@@ -461,7 +461,7 @@ GST_START_TEST (test_gsl_with_transitions)
 
   g_object_get (G_OBJECT (layer), "valid", &valid, NULL);
   fail_unless (!valid);
-  fail_unless_equals_int (count, 2);
+  fail_unless_equals_int (count, 4);
 
   GST_DEBUG ("Removing transitions");