timeline-element: only copy read-write properties

Only copy the properties that can be both read and written, and are not
construct only. Similarly for child properties when a track-element is
deep copied.
This commit is contained in:
Henry Wilkes 2020-04-06 12:26:11 +01:00
parent fe854bba69
commit ba31a8d6a0
2 changed files with 5 additions and 2 deletions

View file

@ -1679,7 +1679,8 @@ ges_timeline_element_copy (GESTimelineElement * self, gboolean deep)
if (g_strcmp0 (specs[n]->name, "parent") && if (g_strcmp0 (specs[n]->name, "parent") &&
g_strcmp0 (specs[n]->name, "timeline") && g_strcmp0 (specs[n]->name, "timeline") &&
g_strcmp0 (specs[n]->name, "name") && g_strcmp0 (specs[n]->name, "name") &&
(specs[n]->flags & G_PARAM_READWRITE) == G_PARAM_READWRITE) { (specs[n]->flags & G_PARAM_READWRITE) == G_PARAM_READWRITE &&
(specs[n]->flags & G_PARAM_CONSTRUCT_ONLY) == 0) {
GValue v = G_VALUE_INIT; GValue v = G_VALUE_INIT;
g_value_init (&v, specs[n]->value_type); g_value_init (&v, specs[n]->value_type);
g_object_get_property (G_OBJECT (self), specs[n]->name, &v); g_object_get_property (G_OBJECT (self), specs[n]->name, &v);

View file

@ -1470,7 +1470,9 @@ ges_track_element_copy_properties (GESTimelineElement * element,
ges_track_element_list_children_properties (GES_TRACK_ELEMENT (element), ges_track_element_list_children_properties (GES_TRACK_ELEMENT (element),
&n_specs); &n_specs);
for (n = 0; n < n_specs; ++n) { for (n = 0; n < n_specs; ++n) {
if (!(specs[n]->flags & G_PARAM_WRITABLE)) if ((specs[n]->flags & G_PARAM_READWRITE) != G_PARAM_READWRITE)
continue;
if (specs[n]->flags & G_PARAM_CONSTRUCT_ONLY)
continue; continue;
g_value_init (&val, specs[n]->value_type); g_value_init (&val, specs[n]->value_type);
ges_track_element_get_child_property_by_pspec (GES_TRACK_ELEMENT (element), ges_track_element_get_child_property_by_pspec (GES_TRACK_ELEMENT (element),