group: fix max layer priority
authorHenry Wilkes <hwilkes@igalia.com>
Mon, 24 Feb 2020 18:58:55 +0000 (18:58 +0000)
committerThibault Saunier <tsaunier@igalia.com>
Thu, 5 Mar 2020 20:04:51 +0000 (17:04 -0300)
The maximum priority is `height - prio - 1`. Previously missing the -1.

Related to, but does not completely fix,
https://gitlab.freedesktop.org/gstreamer/gst-editing-services/issues/91

ges/ges-group.c

index 4afb085..3d4edd6 100644 (file)
@@ -134,10 +134,7 @@ _update_our_values (GESGroup * group)
       gint32 prio = _PRIORITY (child), height = GES_CONTAINER_HEIGHT (child);
 
       min_layer_prio = MIN (prio, min_layer_prio);
-      /* FIXME: the height of the child = (max-priority - min-priority + 1)
-       * the priority of the child = min-priority
-       * so prio + height = max-priority + 1 */
-      max_layer_prio = MAX ((prio + height), max_layer_prio);
+      max_layer_prio = MAX ((prio + height - 1), max_layer_prio);
     }
   }