mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
ges/ges-simple-timeline-layer.c: also error when transition duration exceeds
that of its neighbors
This commit is contained in:
parent
ae34d99867
commit
899f4f35c5
1 changed files with 13 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue