diff --git a/ges/ges-container.c b/ges/ges-container.c index d6ec21d223..e6f6949dad 100644 --- a/ges/ges-container.c +++ b/ges/ges-container.c @@ -127,6 +127,7 @@ _free_mapping (ChildMapping * mapping) ges_timeline_element_set_parent (child, NULL); gst_object_unref (child); } + g_slice_free (ChildMapping, mapping); } @@ -344,14 +345,11 @@ _deep_copy (GESTimelineElement * element, GESTimelineElement * copy) GESContainer *self = GES_CONTAINER (element), *ccopy = GES_CONTAINER (copy); for (tmp = GES_CONTAINER_CHILDREN (element); tmp; tmp = tmp->next) { - ChildMapping *map; - - map = - g_slice_dup (ChildMapping, g_hash_table_lookup (self->priv->mappings, - tmp->data)); + ChildMapping *map, *orig_map; + orig_map = g_hash_table_lookup (self->priv->mappings, tmp->data); + map = g_slice_new0 (ChildMapping); map->child = ges_timeline_element_copy (tmp->data, TRUE); - map->start_notifyid = 0; - map->duration_notifyid = 0; + map->start_offset = orig_map->start_offset; ccopy->priv->copied_children = g_list_prepend (ccopy->priv->copied_children, map); @@ -384,8 +382,7 @@ _paste (GESTimelineElement * element, GESTimelineElement * ref, return NULL; } - ges_timeline_element_set_timeline (GES_TIMELINE_ELEMENT (ncontainer), - GES_TIMELINE_ELEMENT_TIMELINE (ref)); + /* for GESGroups, this may register the group on the timeline */ ges_container_add (ncontainer, nchild); } diff --git a/ges/ges-group.c b/ges/ges-group.c index 097b2f629a..b99ba7c7db 100644 --- a/ges/ges-group.c +++ b/ges/ges-group.c @@ -685,27 +685,6 @@ _group (GList * containers) return ret; } -static GESTimelineElement * -_paste (GESTimelineElement * element, GESTimelineElement * ref, - GstClockTime paste_position) -{ - GESTimelineElement *ngroup = - GES_TIMELINE_ELEMENT_CLASS (parent_class)->paste (element, ref, - paste_position); - - if (ngroup) { - if (GES_CONTAINER_CHILDREN (ngroup)) { - timeline_add_group (GES_TIMELINE_ELEMENT_TIMELINE (GES_CONTAINER_CHILDREN - (ngroup)->data), GES_GROUP (element)); - timeline_emit_group_added (GES_TIMELINE_ELEMENT_TIMELINE - (GES_CONTAINER_CHILDREN (ngroup)->data), GES_GROUP (element)); - } - } - - return ngroup; -} - - /**************************************************** * * * GObject virtual methods implementation * @@ -781,7 +760,6 @@ ges_group_class_init (GESGroupClass * klass) element_class->set_max_duration = _set_max_duration; element_class->set_start = _set_start; element_class->set_priority = _set_priority; - element_class->paste = _paste; /* We override start, inpoint, duration and max-duration from GESTimelineElement * in order to makes sure those fields are not serialized. diff --git a/ges/ges-timeline.c b/ges/ges-timeline.c index 48563ffdd2..3c3dddfdf7 100644 --- a/ges/ges-timeline.c +++ b/ges/ges-timeline.c @@ -332,14 +332,15 @@ ges_timeline_dispose (GObject * object) ges_timeline_remove_track (GES_TIMELINE (object), tl->tracks->data); UNLOCK_DYN (tl); - groups = g_list_copy (priv->groups); + /* NOTE: the timeline should not contain empty groups */ + groups = g_list_copy_deep (priv->groups, (GCopyFunc) gst_object_ref, NULL); for (tmp = groups; tmp; tmp = tmp->next) { GList *elems = ges_container_ungroup (tmp->data, FALSE); g_list_free_full (elems, gst_object_unref); } - g_list_free (priv->groups); - g_list_free (groups); + g_list_free_full (groups, gst_object_unref); + g_list_free_full (priv->groups, gst_object_unref); g_list_free_full (priv->auto_transitions, gst_object_unref);