timeline: Do not compare unsigned with 0
authorThibault Saunier <tsaunier@igalia.com>
Thu, 9 Apr 2020 14:37:20 +0000 (10:37 -0400)
committerThibault Saunier <tsaunier@igalia.com>
Fri, 10 Apr 2020 15:12:12 +0000 (11:12 -0400)
Layer priorities are always positive the check was making no
sense in any case.

Fixes CID: 14449221461284

ges/ges-timeline.c

index 3c3dddfdf70b967be865d9297c8314070e9e886e..bf0559d831f38db8ed5dd7d7467cb43d54af7a32 100644 (file)
@@ -1253,9 +1253,10 @@ timeline_trim_object (GESTimeline * timeline, GESTimelineElement * object,
   }
 
   return timeline_tree_trim (timeline->priv->tree,
-      GES_TIMELINE_ELEMENT (object), new_layer_priority < 0 ? 0 : (gint64)
+      GES_TIMELINE_ELEMENT (object), (gint64)
       ges_timeline_element_get_layer_priority (GES_TIMELINE_ELEMENT (object)) -
-      new_layer_priority, edge == GES_EDGE_END ? GST_CLOCK_DIFF (position,
+      (gint64) new_layer_priority,
+      edge == GES_EDGE_END ? GST_CLOCK_DIFF (position,
           _START (object) + _DURATION (object)) : GST_CLOCK_DIFF (position,
           GES_TIMELINE_ELEMENT_START (object)), edge,
       timeline->priv->snapping_distance);
@@ -1283,9 +1284,10 @@ timeline_move_object (GESTimeline * timeline, GESTimelineElement * object,
       GST_CLOCK_DIFF (position, GES_TIMELINE_ELEMENT_START (object));
 
   ret = timeline_tree_move (timeline->priv->tree,
-      GES_TIMELINE_ELEMENT (object), new_layer_priority < 0 ? 0 : (gint64)
+      GES_TIMELINE_ELEMENT (object), (gint64)
       ges_timeline_element_get_layer_priority (GES_TIMELINE_ELEMENT (object)) -
-      new_layer_priority, offset, edge, timeline->priv->snapping_distance);
+      (gint64) new_layer_priority, offset, edge,
+      timeline->priv->snapping_distance);
 
   return ret;
 }