mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
ges/ges-simple-timeline-layer.c: don't allow user to create timelines with
adjacent transitions
This commit is contained in:
parent
e5ae1405c8
commit
ae34d99867
1 changed files with 17 additions and 0 deletions
|
@ -173,6 +173,23 @@ ges_simple_timeline_layer_add_object (GESSimpleTimelineLayer * layer,
|
|||
|
||||
GST_DEBUG ("layer:%p, object:%p, position:%d", layer, object, position);
|
||||
|
||||
GList *nth = g_list_nth (layer->objects, position);
|
||||
|
||||
if (GES_IS_TIMELINE_TRANSITION (object)) {
|
||||
GList *lprev = g_list_previous (nth);
|
||||
|
||||
GESTimelineObject *prev = GES_TIMELINE_OBJECT (lprev ? lprev->data : NULL);
|
||||
GESTimelineObject *next = GES_TIMELINE_OBJECT (nth ? nth->data : NULL);
|
||||
|
||||
if ((prev && GES_IS_TIMELINE_TRANSITION (prev)) ||
|
||||
(next && GES_IS_TIMELINE_TRANSITION (next))) {
|
||||
GST_ERROR ("Not adding transition: Only insert transitions between two"
|
||||
" sources, or at the begining or end the layer\n");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
layer->adding_object = TRUE;
|
||||
|
||||
res = ges_timeline_layer_add_object ((GESTimelineLayer *) layer, object);
|
||||
|
|
Loading…
Reference in a new issue