Skip to content

Commit

Permalink
start at a lower quality and don't update the values until we have pr…
Browse files Browse the repository at this point in the history
…ocessed a few frames

git-svn-id: https://xpra.org/svn/Xpra/trunk@17461 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Nov 20, 2017
1 parent 76b5ac2 commit 676582e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/xpra/server/window/window_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ def __init__(self,
self._fixed_min_speed = default_encoding_options.get("min-speed", 0)
#will be overriden by update_quality() and update_speed() called from update_encoding_selection()
#just here for clarity:
self._current_quality = 50
self._current_speed = 50
self._current_quality = 40
self._current_speed = 40
self._want_alpha = False
self._lossless_threshold_base = 85
self._lossless_threshold_pixel_boost = 20
Expand Down Expand Up @@ -990,7 +990,7 @@ def update_av_sync_frame_delay(self):
self.may_update_av_sync_delay()

def update_speed(self):
if self.suspended or self._mmap:
if self.suspended or self._mmap or self._sequence<10:
return
speed = self._fixed_speed
if speed<=0:
Expand All @@ -1004,7 +1004,7 @@ def update_speed(self):
info = {}
speed = min(100, speed)
self._current_speed = int(speed)
statslog("update_speed() info=%s, speed=%s", info, self._current_speed)
statslog("update_speed() wid=%s, info=%s, speed=%s", self.wid, info, self._current_speed)
self._encoding_speed.append((monotonic_time(), info, self._current_speed))

def set_min_speed(self, min_speed):
Expand All @@ -1022,8 +1022,7 @@ def get_speed(self, coding):


def update_quality(self):
statslog("update_quality() suspended=%s, mmap=%s, encoding=%s", self.suspended, self._mmap, self.encoding)
if self.suspended or self._mmap:
if self.suspended or self._mmap or self._sequence<10:
return
if self.encoding in ("rgb", "png", "png/P", "png/L"):
#the user has selected an encoding which does not use quality
Expand All @@ -1042,7 +1041,7 @@ def update_quality(self):
info = {}
quality = min(100, quality)
self._current_quality = int(quality)
statslog("update_quality() info=%s, quality=%s", info, self._current_quality)
statslog("update_quality() wid=%i, info=%s, quality=%s", self.wid, info, self._current_quality)
self._encoding_quality.append((monotonic_time(), info, self._current_quality))

def set_min_quality(self, min_quality):
Expand Down

0 comments on commit 676582e

Please sign in to comment.