mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
container: Update start if adding a child that as a start < current start
Reviewed-by: Thibault Saunier <thibault.saunier@collabora.com> Differential Revision: https://phabricator.freedesktop.org/D629
This commit is contained in:
parent
0c46363f74
commit
a526e5634e
1 changed files with 19 additions and 0 deletions
|
@ -134,6 +134,13 @@ compare_grouping_prio (GType * a, GType * b)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_resync_start_offsets (GESTimelineElement * child,
|
||||||
|
ChildMapping * map, GESContainer * container)
|
||||||
|
{
|
||||||
|
map->start_offset = _START (container) - _START (child);
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************
|
/*****************************************************
|
||||||
* *
|
* *
|
||||||
* GESTimelineElement virtual methods implementation *
|
* GESTimelineElement virtual methods implementation *
|
||||||
|
@ -677,6 +684,7 @@ gboolean
|
||||||
ges_container_add (GESContainer * container, GESTimelineElement * child)
|
ges_container_add (GESContainer * container, GESTimelineElement * child)
|
||||||
{
|
{
|
||||||
ChildMapping *mapping;
|
ChildMapping *mapping;
|
||||||
|
gboolean notify_start = FALSE;
|
||||||
GESContainerClass *class;
|
GESContainerClass *class;
|
||||||
GESContainerPrivate *priv;
|
GESContainerPrivate *priv;
|
||||||
|
|
||||||
|
@ -700,6 +708,14 @@ ges_container_add (GESContainer * container, GESTimelineElement * child)
|
||||||
}
|
}
|
||||||
container->children_control_mode = GES_CHILDREN_UPDATE;
|
container->children_control_mode = GES_CHILDREN_UPDATE;
|
||||||
|
|
||||||
|
if (_START (container) > _START (child)) {
|
||||||
|
_START (container) = _START (child);
|
||||||
|
|
||||||
|
g_hash_table_foreach (priv->mappings, (GHFunc) _resync_start_offsets,
|
||||||
|
container);
|
||||||
|
notify_start = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
mapping = g_slice_new0 (ChildMapping);
|
mapping = g_slice_new0 (ChildMapping);
|
||||||
mapping->child = gst_object_ref (child);
|
mapping->child = gst_object_ref (child);
|
||||||
mapping->start_offset = _START (container) - _START (child);
|
mapping->start_offset = _START (container) - _START (child);
|
||||||
|
@ -740,6 +756,9 @@ ges_container_add (GESContainer * container, GESTimelineElement * child)
|
||||||
child);
|
child);
|
||||||
priv->adding_children = g_list_remove (priv->adding_children, child);
|
priv->adding_children = g_list_remove (priv->adding_children, child);
|
||||||
|
|
||||||
|
if (notify_start)
|
||||||
|
g_object_notify (G_OBJECT (container), "start");
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue