[pitivi: 1/3] Avoid exception generating thumbnails for streams having framerate 0/1



commit 93efaeb0fe6021bd0bba6b2ff1e1819f3d5d3be0
Author: Alessandro Decina <alessandro d gmail com>
Date:   Wed Oct 7 16:25:56 2009 +0200

    Avoid exception generating thumbnails for streams having framerate 0/1

 pitivi/ui/previewer.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/pitivi/ui/previewer.py b/pitivi/ui/previewer.py
index a67b49f..cdb7ce2 100644
--- a/pitivi/ui/previewer.py
+++ b/pitivi/ui/previewer.py
@@ -356,9 +356,10 @@ class RandomAccessVideoPreviewer(RandomAccessPreviewer):
             self.aspect = float(stream_.dar)
         rate = stream_.framerate
         RandomAccessPreviewer.__init__(self, factory, stream_)
-        self.frame_duration = (gst.SECOND * rate.denom) / rate.num
-        self.tstep = max(self.frame_duration, 
-            Zoomable.pixelToNsAt(self.twidth, Zoomable.max_zoom))
+        self.tstep = Zoomable.pixelToNsAt(self.twidth, Zoomable.max_zoom)
+        if rate.num:
+            frame_duration = (gst.SECOND * rate.denom) / rate.num
+            self.tstep = max(frame_duration, self.tstep)
 
     def _pipelineInit(self, factory, sbin):
         csp = gst.element_factory_make("ffmpegcolorspace")



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