[pitivi/ges: 123/287] ui: Handle wrong framerate detection from the discoverer
- From: Jean-FranÃois Fortin Tam <jfft src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi/ges: 123/287] ui: Handle wrong framerate detection from the discoverer
- Date: Thu, 15 Mar 2012 16:36:10 +0000 (UTC)
commit 113f1b16745bd537110ed7acee8f52299ab94126
Author: Thibault Saunier <thibault saunier collabora com>
Date: Mon Jan 2 10:30:16 2012 -0300
ui: Handle wrong framerate detection from the discoverer
pitivi/ui/common.py | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/pitivi/ui/common.py b/pitivi/ui/common.py
index 9670486..23e34ae 100644
--- a/pitivi/ui/common.py
+++ b/pitivi/ui/common.py
@@ -125,8 +125,11 @@ def beautify_stream(stream):
par = stream.get_par_num() / stream.get_par_denom()
if not stream.is_image():
templ = _(u"<b>Video:</b> %dÃ%d <i>pixels</i> at %.3f <i>fps</i>")
- templ = templ % (par * stream.get_width(), stream.get_height(),
- float(stream.get_framerate_num()) / stream.get_framerate_denom())
+ try:
+ templ = templ % (par * stream.get_width(), stream.get_height(),
+ float(stream.get_framerate_num()) / stream.get_framerate_denom())
+ except ZeroDivisionError:
+ templ = templ % (par * stream.get_width(), stream.get_height(), 0)
else:
templ = _(u"<b>Image:</b> %dÃ%d <i>pixels</i>")
templ = templ % (par * stream.get_width(), stream.get_height())
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]