Skip to content

Commit

Permalink
also honour the minimum video scaling value when choosing a scaling v…
Browse files Browse the repository at this point in the history
…alue via the heuristics

git-svn-id: https://xpra.org/svn/Xpra/trunk@26658 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jun 9, 2020
1 parent e6e38a7 commit 1307dc4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/xpra/server/window/window_video_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -1441,6 +1441,8 @@ def get_min_required_scaling(default_value=(1, 1)):
#high speed means more scaling:
target = target * 60**2 // (q+20)**2
sscaling = {}
mrs = get_min_required_scaling()
min_ratio = mrs[0]/mrs[1]
for num, denom in SCALING_OPTIONS:
#scaled pixels per second value:
spps = pps*(num**2)/(denom**2)
Expand All @@ -1452,6 +1454,9 @@ def get_min_required_scaling(default_value=(1, 1)):
#try to stick to the same value longer:
#give it a score boost (lowest score wins):
score = int(score/1.5)
if num/denom>min_ratio:
#higher than minimum, should not be used unless we have no choice:
score = int(score*100)
sscaling[score] = (num, denom)
scalinglog("calculate_scaling%s wid=%i, pps=%s, target=%s, scores=%s",
(width, height, max_w, max_h), self.wid, pps, target, sscaling)
Expand Down

0 comments on commit 1307dc4

Please sign in to comment.