Skip to content

Commit

Permalink
#3337 increase lossless threshold when there is congestion
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Nov 8, 2021
1 parent dcbb495 commit 2f6688d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xpra/server/window/window_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,7 @@ def update_encoding_selection(self, encoding=None, exclude=(), init=False):
self.update_refresh_attributes()

def update_encoding_options(self, force_reload=False):
cv = self.global_statistics.congestion_value
self._want_alpha = self.is_tray or (self.has_alpha and self.supports_transparency)
ww, wh = self.window_dimensions
opr = self._opaque_region
Expand All @@ -844,7 +845,7 @@ def update_encoding_options(self, force_reload=False):
if r.contains(0, 0, ww, wh):
#window is fully opaque
self._want_alpha = False
self._lossless_threshold_base = min(90, 60+self._current_speed//5)
self._lossless_threshold_base = min(90, 60+self._current_speed//5 + int(cv*100))
if self.content_type=="text" or self.is_shadow:
self._lossless_threshold_base -= 20
self._lossless_threshold_pixel_boost = max(5, 20-self._current_speed//5)
Expand All @@ -855,7 +856,6 @@ def update_encoding_options(self, force_reload=False):
pcmult = min(20, 0.5+self.statistics.packet_count)/20.0
max_rgb_threshold = 32*1024
min_rgb_threshold = 2048
cv = self.global_statistics.congestion_value
if cv>0.1:
max_rgb_threshold = int(32*1024/(1+cv))
min_rgb_threshold = 1024
Expand Down

0 comments on commit 2f6688d

Please sign in to comment.