pitivi r1431 - trunk/pitivi/timeline



Author: edwardrv
Date: Fri Nov 28 17:37:37 2008
New Revision: 1431
URL: http://svn.gnome.org/viewvc/pitivi?rev=1431&view=rev

Log:
timeline/source: Fix checks for valid media-start and media-duration

We can't *fixup* values once we know we're going to set them.

If values need to be fixed-up (like making sure start is positive) and actually
set, then the conversion needs to be done in the calling functions.

Modified:
   trunk/pitivi/timeline/source.py

Modified: trunk/pitivi/timeline/source.py
==============================================================================
--- trunk/pitivi/timeline/source.py	(original)
+++ trunk/pitivi/timeline/source.py	Fri Nov 28 17:37:37 2008
@@ -106,11 +106,9 @@
             self,
             gst.TIME_ARGS(self.media_start),
             gst.TIME_ARGS(self.media_duration)))
-        if duration > 0 and not self.media_duration == duration:
-            duration = max(0, min(duration, self.factory.duration))
+        if (duration > 0) and (not self.media_duration == duration) and (duration <= self.factory.duration):
             self.gnlobject.set_property("media-duration", long(duration))
-        if not start == gst.CLOCK_TIME_NONE and not self.media_start == start:
-            start = max(0, start)
+        if (not start == gst.CLOCK_TIME_NONE) and (not self.media_start == start) and (start >= 0):
             self.gnlobject.set_property("media-start", long(start))
 
     # override setInTime and setOutTime methods to handle media-start/duration



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]