From f7dbdd27babbb6dbf1379944221e25fb5a496bae Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Tue, 30 Jun 2015 23:13:28 +0200 Subject: [PATCH] clip: Fix track element priority computation We were computing the priority offset taking the global MIN_NLE_PRIO (which is a constant == 2 to make space for the mixing elements) instead of the layer 'track element' relative priority, leading to very big offsets on layer with a prio > 0. In the end it leaded to effects having the same priority as the sources which leads to an undefined behaviour in NLE. --- ges/ges-clip.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ges/ges-clip.c b/ges/ges-clip.c index 6e9782435d..380a32deee 100644 --- a/ges/ges-clip.c +++ b/ges/ges-clip.c @@ -223,10 +223,14 @@ _set_priority (GESTimelineElement * element, guint32 priority) for (tmp = container->children; tmp; tmp = g_list_next (tmp)) { guint32 real_tck_prio; GESTimelineElement *child = (GESTimelineElement *) tmp->data; - gint off = _PRIORITY (child) - _PRIORITY (element) - MIN_NLE_PRIO; + gint off = _PRIORITY (child) - _PRIORITY (element) - min_prio; - if (off >= LAYER_HEIGHT) + if (off >= LAYER_HEIGHT) { + GST_ERROR ("%s child %s as a priority offset %d >= LAYER_HEIGHT %d" + "clamping it to 0", GES_TIMELINE_ELEMENT_NAME (element), + GES_TIMELINE_ELEMENT_NAME (child), off, LAYER_HEIGHT); off = 0; + } real_tck_prio = min_prio + priority + off;