timeline-element: only copy read-write properties
authorHenry Wilkes <hwilkes@igalia.com>
Mon, 6 Apr 2020 11:26:11 +0000 (12:26 +0100)
committerHenry Wilkes <hwilkes@igalia.com>
Wed, 8 Apr 2020 13:35:28 +0000 (14:35 +0100)
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.

ges/ges-timeline-element.c
ges/ges-track-element.c

index 1d082b862f18730e44991d55c2abf805645ff087..3498d8fca2685c54155f51323b1931d2394aa05f 100644 (file)
@@ -1679,7 +1679,8 @@ ges_timeline_element_copy (GESTimelineElement * self, gboolean deep)
     if (g_strcmp0 (specs[n]->name, "parent") &&
         g_strcmp0 (specs[n]->name, "timeline") &&
         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;
       g_value_init (&v, specs[n]->value_type);
       g_object_get_property (G_OBJECT (self), specs[n]->name, &v);
index ec7d178442819bc7897be687ac4534a1896fd0a4..240d89cbb750d52b21b9492b76fc173edcc8eb13 100644 (file)
@@ -1470,7 +1470,9 @@ ges_track_element_copy_properties (GESTimelineElement * element,
       ges_track_element_list_children_properties (GES_TRACK_ELEMENT (element),
       &n_specs);
   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;
     g_value_init (&val, specs[n]->value_type);
     ges_track_element_get_child_property_by_pspec (GES_TRACK_ELEMENT (element),