[pitivi] previewers: Improve the clarity of rate modifications in PipelineCpuAdapter



commit be1cdf3eb41669c261972c654dd1599a353fc438
Author: Jean-François Fortin Tam <nekohayo gmail com>
Date:   Tue Jul 2 00:15:06 2013 -0400

    previewers: Improve the clarity of rate modifications in PipelineCpuAdapter

 pitivi/timeline/previewers.py |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/pitivi/timeline/previewers.py b/pitivi/timeline/previewers.py
index 3295c01..952a605 100644
--- a/pitivi/timeline/previewers.py
+++ b/pitivi/timeline/previewers.py
@@ -531,8 +531,6 @@ class PipelineCpuAdapter(Loggable):
         self.lastMoment = datetime.now()
         self.lastUsage = resource.getrusage(resource.RUSAGE_SELF)
         self.rate = 1.0
-        self.growthFactor = 0.1
-        self.decreaseFactor = 0.1
         self.done = False
         self.ready = False
         self.lastPos = 0
@@ -563,10 +561,10 @@ class PipelineCpuAdapter(Loggable):
             return True
 
         if usage_percent >= WAVEFORMS_CPU_USAGE and self.rate > 0.0:
-            self.rate -= self.rate * self.decreaseFactor
+            self.rate *= 0.9
             self.log('Pipeline rate slowed down (-10%%) to %.3f' % self.rate)
         elif usage_percent < WAVEFORMS_CPU_USAGE:
-            self.rate += self.rate * self.growthFactor
+            self.rate *= 1.1
             self.log('Pipeline rate sped up (+10%%) to %.3f' % self.rate)
 
         if not self.ready:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]