[pitivi/ges] Prevent calculating setBestZoomRatio with empty timelines
- From: Jean-FranÃois Fortin Tam <jfft src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi/ges] Prevent calculating setBestZoomRatio with empty timelines
- Date: Fri, 27 Apr 2012 20:11:10 +0000 (UTC)
commit 7f5b35f03d83ac482e828b3628648d7ea70632de
Author: Jean-FranÃois Fortin Tam <nekohayo gmail com>
Date: Thu Apr 26 19:56:59 2012 -0400
Prevent calculating setBestZoomRatio with empty timelines
pitivi/mainwindow.py | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/mainwindow.py b/pitivi/mainwindow.py
index 05c924e..135449c 100644
--- a/pitivi/mainwindow.py
+++ b/pitivi/mainwindow.py
@@ -767,6 +767,9 @@ class PitiviMainWindow(gtk.Window, Loggable):
# Add gst.SECOND - 1 to the timeline duration to make sure the
# last second of the timeline will be in view.
duration = self.app.current.timeline.props.duration
+ if duration == 0:
+ self.debug("The timeline duration is 0, impossible to calculate zoom")
+ return
timeline_duration = duration + gst.SECOND - 1
timeline_duration_s = int(timeline_duration / gst.SECOND)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]