[pitivi/ges: 67/287] Do not try to seek where it is not possible



commit 2280aa3bc307c06d8757562dc49d365529afb998
Author: Thibault Saunier <thibault saunier collabora com>
Date:   Mon Oct 24 16:34:06 2011 +0200

    Do not try to seek where it is not possible

 pitivi/ui/mainwindow.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/pitivi/ui/mainwindow.py b/pitivi/ui/mainwindow.py
index f41841a..533b61e 100644
--- a/pitivi/ui/mainwindow.py
+++ b/pitivi/ui/mainwindow.py
@@ -1075,13 +1075,14 @@ class PitiviMainWindow(gtk.Window, Loggable):
 
     def _timelineSeekCb(self, ruler, position, format):
         try:
-            self.project_pipeline.seek(1.0, format, gst.SEEK_FLAG_FLUSH,
-                                  gst.SEEK_TYPE_SET, position,
-                                  gst.SEEK_TYPE_NONE, -1)
             if position < 0:
                 position = 0
             elif position >= self.timeline.getDuration():
                 position = self.timeline.getDuration()
+
+            self.project_pipeline.seek(1.0, format, gst.SEEK_FLAG_FLUSH,
+                                  gst.SEEK_TYPE_SET, position,
+                                  gst.SEEK_TYPE_NONE, -1)
             self.timeline.timelinePositionChanged(position)
 
         except Exception, e:



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