[pitivi] previewer: lower thumbnail creation GSource priority
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] previewer: lower thumbnail creation GSource priority
- Date: Wed, 1 Jul 2015 16:14:16 +0000 (UTC)
commit c0384480b82aa1d7cf890d27d685ac6aca0bac53
Author: Thibault Saunier <tsaunier gnome org>
Date: Wed Jul 1 18:12:57 2015 +0200
previewer: lower thumbnail creation GSource priority
Otherwise we can end up eating the mainloop in some corner cases
pitivi/timeline/previewers.py | 5 +++--
pitivi/utils/system.py | 3 +--
2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/pitivi/timeline/previewers.py b/pitivi/timeline/previewers.py
index 3f57b7c..eab9244 100644
--- a/pitivi/timeline/previewers.py
+++ b/pitivi/timeline/previewers.py
@@ -267,8 +267,9 @@ class VideoPreviewer(Gtk.Layout, PreviewGenerator, Zoomable, Loggable):
'Thumbnailing slowed down (-10%%) to a %.1f ms interval for "%s"' %
(self.interval, filename_from_uri(self.uri)))
self.cpu_usage_tracker.reset()
- self._thumb_cb_id = GLib.timeout_add(
- self.interval, self._create_next_thumb)
+ self._thumb_cb_id = GLib.timeout_add(self.interval,
+ self._create_next_thumb,
+ priority=GLib.PRIORITY_LOW)
def _startThumbnailingWhenIdle(self):
self.debug(
diff --git a/pitivi/utils/system.py b/pitivi/utils/system.py
index acb4f88..ee07fae 100644
--- a/pitivi/utils/system.py
+++ b/pitivi/utils/system.py
@@ -309,8 +309,7 @@ class CPUUsageTracker(object):
self.reset()
def usage(self):
- delta_time = (datetime.datetime.now()
- - self.last_moment).total_seconds()
+ delta_time = (datetime.datetime.now() - self.last_moment).total_seconds()
delta_usage = resource.getrusage(
resource.RUSAGE_SELF).ru_utime - self.last_usage.ru_utime
usage = float(delta_usage) / delta_time * 100
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]