layer is also invalid when there are transitoins at the beginning/end

This commit is contained in:
Brandon Lewis 2010-08-05 15:46:02 +02:00 committed by Edward Hervey
parent 03e488ac74
commit 6e844f877f
2 changed files with 16 additions and 8 deletions

View 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));

View 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");