[pitivi] previewers: Fix initial value of AudioPreviewer.lastUpdate
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] previewers: Fix initial value of AudioPreviewer.lastUpdate
- Date: Wed, 24 Sep 2014 17:06:22 +0000 (UTC)
commit 67b9d5ca04549f50674548e1bf0c501b78730a7f
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Wed Apr 30 06:00:29 2014 +0200
previewers: Fix initial value of AudioPreviewer.lastUpdate
pitivi/timeline/previewers.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/pitivi/timeline/previewers.py b/pitivi/timeline/previewers.py
index 302faf6..ffffb29 100644
--- a/pitivi/timeline/previewers.py
+++ b/pitivi/timeline/previewers.py
@@ -756,7 +756,7 @@ class AudioPreviewer(Clutter.Actor, PreviewGenerator, Zoomable, Loggable):
self.set_content(self.canvas)
self.width = 0
self._num_failures = 0
- self.lastUpdate = datetime.now()
+ self.lastUpdate = None
self.current_geometry = (-1, -1)
@@ -811,7 +811,8 @@ class AudioPreviewer(Clutter.Actor, PreviewGenerator, Zoomable, Loggable):
def _maybeUpdate(self):
if self.discovered:
self.log('Checking if the waveform for "%s" needs to be redrawn' % self._uri)
- if datetime.now() - self.lastUpdate > WAVEFORM_UPDATE_INTERVAL:
+ if self.lastUpdate is None or datetime.now() - self.lastUpdate > WAVEFORM_UPDATE_INTERVAL:
+ # Last update was long ago or never.
self.lastUpdate = datetime.now()
self._compute_geometry()
else:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]