[pitivi/ges] viewer: Limit the live trim preview to one seek per 200 ms
- From: Jean-FranÃois Fortin Tam <jfft src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi/ges] viewer: Limit the live trim preview to one seek per 200 ms
- Date: Sun, 25 Mar 2012 21:54:25 +0000 (UTC)
commit 8427a2f117037b53790e83391f686a610f3466bf
Author: Jean-FranÃois Fortin Tam <nekohayo gmail com>
Date: Wed Mar 7 19:16:03 2012 -0500
viewer: Limit the live trim preview to one seek per 200 ms
pitivi/viewer.py | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/viewer.py b/pitivi/viewer.py
index 5b73cd3..39beafd 100644
--- a/pitivi/viewer.py
+++ b/pitivi/viewer.py
@@ -26,6 +26,7 @@ import gst
import cairo
from gettext import gettext as _
+from time import time
from pitivi.utils.loggable import Loggable
from pitivi.settings import GlobalSettings
@@ -489,11 +490,16 @@ class PitiviViewer(gtk.VBox, Loggable):
"""
While a clip is being trimmed, show a live preview of it.
"""
+ cur_time = time()
if not self._tmp_pipeline:
self._tmp_pipeline = gst.element_factory_make("playbin2")
self._tmp_pipeline.set_property("uri", clip_uri)
self.setPipeline(self._tmp_pipeline)
- self._tmp_pipeline.seek_simple(gst.FORMAT_TIME, gst.SEEK_FLAG_FLUSH, position)
+ self._lastClipTrimTime = cur_time
+ if (cur_time - self._lastClipTrimTime) > 0.2:
+ # Do not seek more than once every 200 ms (for performance)
+ self._tmp_pipeline.seek_simple(gst.FORMAT_TIME, gst.SEEK_FLAG_FLUSH, position)
+ self._lastClipTrimTime = cur_time
def clipTrimPreviewFinished(self):
"""
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]