[pitivi] proxy: Make field local variable
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] proxy: Make field local variable
- Date: Mon, 16 Jan 2017 08:03:24 +0000 (UTC)
commit 3f79723a5b59b77587a1df95744dcbb514e4fa84
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Thu Jan 5 12:26:59 2017 +0100
proxy: Make field local variable
Reviewed-by: Thibault Saunier <tsaunier gnome org>
Differential Revision: https://phabricator.freedesktop.org/D1598
pitivi/utils/proxy.py | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/pitivi/utils/proxy.py b/pitivi/utils/proxy.py
index b29aabe..241a5b0 100644
--- a/pitivi/utils/proxy.py
+++ b/pitivi/utils/proxy.py
@@ -104,7 +104,6 @@ class ProxyManager(GObject.Object, Loggable):
self._total_time_to_transcode = 0
self._total_transcoded_time = 0
self._start_proxying_time = 0
- self._estimated_time = 0
self.__running_transcoders = []
self.__pending_transcoders = []
@@ -324,15 +323,14 @@ class ProxyManager(GObject.Object, Loggable):
def __emitProgress(self, asset, progress):
if self._total_transcoded_time:
time_spent = time.time() - self._start_proxying_time
- self._estimated_time = max(
+ estimated_time = max(
0, (time_spent * self._total_time_to_transcode /
self._total_transcoded_time) - time_spent)
else:
- self._estimated_time = 0
+ estimated_time = 0
asset.creation_progress = progress
- self.emit("progress", asset, asset.creation_progress,
- self._estimated_time)
+ self.emit("progress", asset, asset.creation_progress, estimated_time)
def __proxyingPositionChangedCb(self, transcoder, position, asset):
# Do not set to >= 100 as we need to notify about the proxy first
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]