gst-editing-services: ges: Make sure not to set transition start to negative

Thibault Saunier tsaunier at kemper.freedesktop.org
Wed Jan 11 07:04:32 PST 2012


Module: gst-editing-services
Branch: master
Commit: 2fe6210383448f79f28e4259f3d133a01498c049
URL:    http://cgit.freedesktop.org/gstreamer/gst-editing-services/commit/?id=2fe6210383448f79f28e4259f3d133a01498c049

Author: Thibault Saunier <thibault.saunier at collabora.com>
Date:   Tue Dec  6 18:04:11 2011 -0300

ges: Make sure not to set transition start to negative

gnlobject.start is a guint64, we can not set it to a negative value

---

 ges/ges-simple-timeline-layer.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/ges/ges-simple-timeline-layer.c b/ges/ges-simple-timeline-layer.c
index 104580b..6a38170 100644
--- a/ges/ges-simple-timeline-layer.c
+++ b/ges/ges-simple-timeline-layer.c
@@ -163,7 +163,7 @@ static void
 gstl_recalculate (GESSimpleTimelineLayer * self)
 {
   GList *tmp;
-  GstClockTime pos = 0;
+  gint64 pos = 0;
   gint priority = 0;
   gint transition_priority = 0;
   gint height;
@@ -210,9 +210,11 @@ gstl_recalculate (GESSimpleTimelineLayer * self)
     } else if (GES_IS_TIMELINE_TRANSITION (obj)) {
 
       pos -= dur;
+      if (pos < 0)
+        pos = 0;
 
-      GST_LOG ("%p obj: height: %d: trans_priority %d", obj, height,
-          transition_priority);
+      GST_LOG ("%p obj: height: %d: trans_priority %d Position: %d, "
+          "duration %d", obj, height, transition_priority, pos);
 
       g_assert (transition_priority != -1);
 



More information about the gstreamer-commits mailing list