[pitivi] timeline/previewers: don't try to show waveforms when pixelWidth == 0.



commit c999822449e0047a9512f9585ef0d2caa68cb54b
Author: Mathieu Duponchelle <mathieu duponchelle epitech eu>
Date:   Wed Aug 7 17:05:48 2013 +0200

    timeline/previewers: don't try to show waveforms when pixelWidth == 0.
    
    Otherwise we divided by zero.

 pitivi/timeline/previewers.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/timeline/previewers.py b/pitivi/timeline/previewers.py
index cc411b7..02f5f69 100644
--- a/pitivi/timeline/previewers.py
+++ b/pitivi/timeline/previewers.py
@@ -828,6 +828,9 @@ class AudioPreviewer(Clutter.Actor, PreviewGenerator, Zoomable, Loggable):
 
         pixelWidth = self.nsToPixel(self.bElement.props.duration)
 
+        if pixelWidth <= 0:
+            return
+
         self.start = int(start / pixelWidth * self.nbSamples)
         self.end = int(end / pixelWidth * self.nbSamples)
         self.width = int(end - start)


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