[pitivi] pipeline: Simplify logging of obtained duration value
- From: Mathieu Duponchelle <mathieudu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] pipeline: Simplify logging of obtained duration value
- Date: Fri, 28 Feb 2014 03:11:49 +0000 (UTC)
commit bf0ea76a740f16106e3ee4c570fb3d02d99bbcb7
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Mon Jan 20 22:23:09 2014 +0100
pipeline: Simplify logging of obtained duration value
pitivi/utils/misc.py | 2 ++
pitivi/utils/pipeline.py | 5 +----
2 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/pitivi/utils/misc.py b/pitivi/utils/misc.py
index 86be75c..2e8dbdf 100644
--- a/pitivi/utils/misc.py
+++ b/pitivi/utils/misc.py
@@ -62,6 +62,8 @@ def between(a, b, c):
def format_ns(time):
+ if time is None:
+ return None
if time == Gst.CLOCK_TIME_NONE:
return "CLOCK_TIME_NONE"
diff --git a/pitivi/utils/pipeline.py b/pitivi/utils/pipeline.py
index 3024b2c..f947eac 100644
--- a/pitivi/utils/pipeline.py
+++ b/pitivi/utils/pipeline.py
@@ -307,10 +307,7 @@ class SimplePipeline(Signallable, Loggable):
self.log("format %r", format)
dur = self._getDuration(format)
- if dur is None:
- self.info("Invalid duration: None")
- else:
- self.log("Got duration %s", format_ns(dur))
+ self.log("Got duration %s", format_ns(dur))
if self._duration != dur:
self.emit("duration-changed", dur)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]